Skip to content

Commit 29f8e72

Browse files
Subhadeep Karanmeta-codesync[bot]
authored andcommitted
Fix typos in utils and GPU directories (#4671)
Summary: Pull Request resolved: #4671 Fixed typos in comments, documentation, and code across utils/ and gpu/ directories: utils/: - Fixed 33 typos including variable names (bissect_cycles) - Fixed array index typos in approx_topk.h pseudocode - Fixed comment typos in SIMD libraries, partitioning, heap, etc. gpu/: - Fixed 23 typos across CUDA and C++ GPU implementation files - Fixed variable name typo: queryNormNiew → queryNormView - Fixed parameter name typo: chuk_size → chunk_size - Fixed common typo 'neigbors' → 'neighbors' (5 occurrences) All changes are in comments/documentation except for critical variable name fixes. Reviewed By: alibeklfc Differential Revision: D86571371 fbshipit-source-id: 71c88150ca38ac7dbf11b8aab4f623c6c0043531
1 parent ff1a2d4 commit 29f8e72

32 files changed

+50
-50
lines changed

faiss/gpu/GpuIndexCagra.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void GpuIndexCagra::copyFrom_ex(
362362
FAISS_ASSERT(base_index);
363363
auto dataset = (uint8_t*)base_index->codes.data();
364364

365-
// decode what was encded by Quantizer8bitDirectSigned in
365+
// decode what was encoded by Quantizer8bitDirectSigned in
366366
// ScalarQuantizer
367367
int8_t* decoded_train_dataset = new int8_t[index->ntotal * index->d];
368368
for (int i = 0; i < index->ntotal * this->d; i++) {

faiss/gpu/impl/CuvsIVFFlat.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct CuvsIVFFlatCodePackerInterleaved : CodePacker {
135135
CuvsIVFFlatCodePackerInterleaved(
136136
size_t list_size,
137137
uint32_t dim,
138-
uint32_t chuk_size);
138+
uint32_t chunk_size);
139139
void pack_1(const uint8_t* flat_code, size_t offset, uint8_t* block)
140140
const final;
141141
void unpack_1(const uint8_t* block, size_t offset, uint8_t* flat_code)

faiss/gpu/impl/Distance.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void runDistance(
254254

255255
auto queryView =
256256
queries.narrow(queriesRowMajor ? 0 : 1, i, curQuerySize);
257-
auto queryNormNiew = queryNorms.narrow(0, i, curQuerySize);
257+
auto queryNormView = queryNorms.narrow(0, i, curQuerySize);
258258

259259
auto outDistanceBufRowView =
260260
outDistanceBufs[curStream]->narrow(0, 0, curQuerySize);
@@ -321,7 +321,7 @@ void runDistance(
321321
// along rows top-k ||c||^2 - 2qc + ||q||^2 in the form
322322
// (query id, k)
323323
runSumAlongRows(
324-
queryNormNiew,
324+
queryNormView,
325325
outDistanceView,
326326
true, // L2 distances should not go below zero
327327
// due to roundoff error
@@ -345,7 +345,7 @@ void runDistance(
345345
// along rows top-k ||c||^2 - 2qc + ||q||^2 in the form
346346
// (query id, k)
347347
runSumAlongRows(
348-
queryNormNiew,
348+
queryNormView,
349349
outDistanceBufColView,
350350
true, // L2 distances should not go below zero
351351
// due to roundoff error

faiss/gpu/impl/IVFAppend.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace faiss {
2222
namespace gpu {
2323

2424
//
25-
// IVF list metadata aupdate
25+
// IVF list metadata update
2626
//
2727

2828
// Updates the device-size array of list start pointers for codes and indices

faiss/gpu/impl/IVFBase.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class IVFBase {
8787
Tensor<float, 2, true>& vecs,
8888
Tensor<idx_t, 1, true>& indices);
8989

90-
/// Find the approximate k nearest neigbors for `queries` against
90+
/// Find the approximate k nearest neighbors for `queries` against
9191
/// our database
9292
virtual void search(
9393
Index* coarseQuantizer,

faiss/gpu/impl/IVFFlat.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class IVFFlat : public IVFBase {
2929

3030
~IVFFlat() override;
3131

32-
/// Find the approximate k nearest neigbors for `queries` against
32+
/// Find the approximate k nearest neighbors for `queries` against
3333
/// our database
3434
void search(
3535
Index* coarseQuantizer,

faiss/gpu/impl/IVFPQ.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ std::vector<uint8_t> IVFPQ::translateCodesToGpu_(
300300
std::move(up), numVecs, numSubQuantizers_, bitsPerSubQuantizer_);
301301
}
302302

303-
// Conver the GPU layout to the CPU layout
303+
// Convert the GPU layout to the CPU layout
304304
std::vector<uint8_t> IVFPQ::translateCodesFromGpu_(
305305
std::vector<uint8_t> codes,
306306
idx_t numVecs) const {

faiss/gpu/impl/IVFPQ.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class IVFPQ : public IVFBase {
4545
/// (sub q)(code id)(sub dim)
4646
Tensor<float, 3, true> getPQCentroids();
4747

48-
/// Find the approximate k nearest neigbors for `queries` against
48+
/// Find the approximate k nearest neighbors for `queries` against
4949
/// our database
5050
void search(
5151
Index* coarseQuantizer,

faiss/gpu/impl/IVFUtils.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ size_t getIVFPerQueryTempMemory(size_t k, size_t nprobe, size_t maxListLength) {
3939
// Storage for all distances from all the IVF lists we are processing
4040
size_t allDistances = nprobe * maxListLength * sizeof(float);
4141

42-
// There are 2 streams on which computations is performed (hence the 2 *)
42+
// There are 2 streams on which computation is performed (hence the 2 *)
4343
return 2 * (prefixSumOffsets + allDistances + sizeForFirstSelectPass);
4444
}
4545

@@ -57,7 +57,7 @@ size_t getIVFPQPerQueryTempMemory(
5757
: (nprobe * numSubQuantizers * numSubQuantizerCodes *
5858
sizeof(float));
5959

60-
// There are 2 streams on which computations is performed (hence the 2 *)
60+
// There are 2 streams on which computation is performed (hence the 2 *)
6161
// The IVF-generic temp memory allocation already takes this multi-streaming
6262
// into account, but we need to do so for the PQ residual distances too
6363
return (2 * residualDistances) +

faiss/gpu/impl/IcmEncoder.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct IcmEncoderImpl {
2424
std::shared_ptr<GpuResources> res;
2525
int device;
2626

27-
DeviceTensor<float, 4, true> bterm; ///< bianry terms, size [M, M, K, K]
27+
DeviceTensor<float, 4, true> bterm; ///< binary terms, size [M, M, K, K]
2828
DeviceTensor<float, 3, true> codebooks; ///< codebooks, size [M, K, dims]
2929

3030
IcmEncoderImpl(

0 commit comments

Comments
 (0)