Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dx][make] check env and attempt to give advice to get it to build #5

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

blandinw
Copy link

No description provided.

@mdouze
Copy link
Contributor

mdouze commented Feb 15, 2017

That looks cute!
Could you make the test for swig non-mandatory? The new repo contains pre-generated code for the swig part.

@blandinw
Copy link
Author

The .swig-ok rule is only used for the py and lua targets, so it should not complain if you just run the default/other targets.
Would that fit your requirement?

@mdouze mdouze merged this pull request into master Feb 16, 2017
@mdouze
Copy link
Contributor

mdouze commented Feb 16, 2017

I will merge this pull and edit it the way I want.

@mdouze mdouze deleted the wly-make-help branch March 1, 2017 10:10
yuhaijun999 pushed a commit to yuhaijun999/faiss that referenced this pull request Oct 19, 2023
… ==0 and then search. crash.

for example:

int d = 64; // dimension;
    int nb = 1; // database size
    int nq = 1; // nb of queries

    std::mt19937 rng;
    std::uniform_real_distribution<> distrib;

    float* xb = new float[d * nb];
    float* xq = new float[d * nq];

    for (int i = 0; i < nb; i++) {
        for (int j = 0; j < d; j++)
            xb[d * i + j] = distrib(rng);
        xb[d * i] += i / 1000.;
    }

    for (int i = 0; i < nq; i++) {
        for (int j = 0; j < d; j++)
            xq[d * i + j] = distrib(rng);
        xq[d * i] += i / 1000.;
    }

    int nlist = 1;
    int k = 1;
    int m = 8;
    size_t nbits_per_idx = 0;
    faiss::IndexFlatL2 quantizer(d);
    faiss::IndexIVFPQ index(&quantizer, d, nlist, m, nbits_per_idx);

    index.train(nb, xb);
    index.add(nb, xb);

    { // with param
        int query_count = 1;
        // sanity check
        idx_t* I = new idx_t[k * query_count];
        float* D = new float[k * query_count];

        index.search(query_count, xq, k, D, I);  // crash. Segmentation fault (core dumped)

        printf("I=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%5zd ", I[i * k + j]);
            printf("\n");
        }

        printf("D=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%7g ", D[i * k + j]);
            printf("\n");
        }

        delete[] I;
        delete[] D;
    }

./14-IVFPQ_crash
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
Segmentation fault (core dumped)

faiss/faiss/impl/ProductQuantizer-inl.h
 72│ inline uint64_t PQDecoderGeneric::decode() {
 73│     if (offset == 0) {
 74├───────> reg = *code;
 75│     }
 76│     uint64_t c = (reg >> offset);
 77│
 78│     if (offset + nbits >= 8) {
 79│         uint64_t e = 8 - offset;
 80│         ++code;
 81│         for (int i = 0; i < (nbits - (8 - offset)) / 8; ++i) {
 82│             c |= ((uint64_t)(*code++) << e);
 83│             e += 8;
 84│         }
 85│
 86│         offset += nbits;
 87│         offset &= 7;

 (gdb) bt
    ncode=1, codes=0x0, res=...) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:908
    k=1) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:1242
    at /home/user/source2/faiss/faiss/IndexIVF.cpp:448

faiss/faiss/IndexIVF.cpp
561├───────────────────> nheap += scanner->scan_codes(
 562│                             list_size, codes, ids, simi, idxi, k);  // codes is empty. not alloc any memmory.
 563│
 564│                     return list_size;
 565│                 }
 566│             } catch (const std::exception& e) {
 567│                 std::lock_guard<std::mutex> lock(exception_mutex);
 568│                 exception_string =
 569│                         demangle_cpp_symbol(typeid(e).name()) + "  " + e.what();
 570│                 interrupt = true;
 571│                 return size_t(0);
 572│             }
 573│         };
 574│

 facebookresearch#5  0x0000000000411d96 in operator() (__closure=0x7fffffffa5c0, key=0, coarse_dis_i=11.6475525, simi=0x584510, idxi=0x5844f0, list_size_max=9223372036854775807) at /home/user/source2/faiss/faiss/IndexIVF.cpp:561
yuhaijun999 pushed a commit to yuhaijun999/faiss that referenced this pull request Oct 25, 2023
… ==0 and then search. crash.

for example:

int d = 64; // dimension;
    int nb = 1; // database size
    int nq = 1; // nb of queries

    std::mt19937 rng;
    std::uniform_real_distribution<> distrib;

    float* xb = new float[d * nb];
    float* xq = new float[d * nq];

    for (int i = 0; i < nb; i++) {
        for (int j = 0; j < d; j++)
            xb[d * i + j] = distrib(rng);
        xb[d * i] += i / 1000.;
    }

    for (int i = 0; i < nq; i++) {
        for (int j = 0; j < d; j++)
            xq[d * i + j] = distrib(rng);
        xq[d * i] += i / 1000.;
    }

    int nlist = 1;
    int k = 1;
    int m = 8;
    size_t nbits_per_idx = 0;
    faiss::IndexFlatL2 quantizer(d);
    faiss::IndexIVFPQ index(&quantizer, d, nlist, m, nbits_per_idx);

    index.train(nb, xb);
    index.add(nb, xb);

    { // with param
        int query_count = 1;
        // sanity check
        idx_t* I = new idx_t[k * query_count];
        float* D = new float[k * query_count];

        index.search(query_count, xq, k, D, I);  // crash. Segmentation fault (core dumped)

        printf("I=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%5zd ", I[i * k + j]);
            printf("\n");
        }

        printf("D=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%7g ", D[i * k + j]);
            printf("\n");
        }

        delete[] I;
        delete[] D;
    }

./14-IVFPQ_crash
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
Segmentation fault (core dumped)

faiss/faiss/impl/ProductQuantizer-inl.h
 72│ inline uint64_t PQDecoderGeneric::decode() {
 73│     if (offset == 0) {
 74├───────> reg = *code;
 75│     }
 76│     uint64_t c = (reg >> offset);
 77│
 78│     if (offset + nbits >= 8) {
 79│         uint64_t e = 8 - offset;
 80│         ++code;
 81│         for (int i = 0; i < (nbits - (8 - offset)) / 8; ++i) {
 82│             c |= ((uint64_t)(*code++) << e);
 83│             e += 8;
 84│         }
 85│
 86│         offset += nbits;
 87│         offset &= 7;

 (gdb) bt
    ncode=1, codes=0x0, res=...) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:908
    k=1) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:1242
    at /home/user/source2/faiss/faiss/IndexIVF.cpp:448

faiss/faiss/IndexIVF.cpp
561├───────────────────> nheap += scanner->scan_codes(
 562│                             list_size, codes, ids, simi, idxi, k);  // codes is empty. not alloc any memmory.
 563│
 564│                     return list_size;
 565│                 }
 566│             } catch (const std::exception& e) {
 567│                 std::lock_guard<std::mutex> lock(exception_mutex);
 568│                 exception_string =
 569│                         demangle_cpp_symbol(typeid(e).name()) + "  " + e.what();
 570│                 interrupt = true;
 571│                 return size_t(0);
 572│             }
 573│         };
 574│

 facebookresearch#5  0x0000000000411d96 in operator() (__closure=0x7fffffffa5c0, key=0, coarse_dis_i=11.6475525, simi=0x584510, idxi=0x5844f0, list_size_max=9223372036854775807) at /home/user/source2/faiss/faiss/IndexIVF.cpp:561
yuhaijun999 pushed a commit to yuhaijun999/faiss that referenced this pull request Oct 25, 2023
… ==0 and then search. crash.

for example:

int d = 64; // dimension;
    int nb = 1; // database size
    int nq = 1; // nb of queries

    std::mt19937 rng;
    std::uniform_real_distribution<> distrib;

    float* xb = new float[d * nb];
    float* xq = new float[d * nq];

    for (int i = 0; i < nb; i++) {
        for (int j = 0; j < d; j++)
            xb[d * i + j] = distrib(rng);
        xb[d * i] += i / 1000.;
    }

    for (int i = 0; i < nq; i++) {
        for (int j = 0; j < d; j++)
            xq[d * i + j] = distrib(rng);
        xq[d * i] += i / 1000.;
    }

    int nlist = 1;
    int k = 1;
    int m = 8;
    size_t nbits_per_idx = 0;
    faiss::IndexFlatL2 quantizer(d);
    faiss::IndexIVFPQ index(&quantizer, d, nlist, m, nbits_per_idx);

    index.train(nb, xb);
    index.add(nb, xb);

    { // with param
        int query_count = 1;
        // sanity check
        idx_t* I = new idx_t[k * query_count];
        float* D = new float[k * query_count];

        index.search(query_count, xq, k, D, I);  // crash. Segmentation fault (core dumped)

        printf("I=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%5zd ", I[i * k + j]);
            printf("\n");
        }

        printf("D=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%7g ", D[i * k + j]);
            printf("\n");
        }

        delete[] I;
        delete[] D;
    }

./14-IVFPQ_crash
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
Segmentation fault (core dumped)

faiss/faiss/impl/ProductQuantizer-inl.h
 72│ inline uint64_t PQDecoderGeneric::decode() {
 73│     if (offset == 0) {
 74├───────> reg = *code;
 75│     }
 76│     uint64_t c = (reg >> offset);
 77│
 78│     if (offset + nbits >= 8) {
 79│         uint64_t e = 8 - offset;
 80│         ++code;
 81│         for (int i = 0; i < (nbits - (8 - offset)) / 8; ++i) {
 82│             c |= ((uint64_t)(*code++) << e);
 83│             e += 8;
 84│         }
 85│
 86│         offset += nbits;
 87│         offset &= 7;

 (gdb) bt
    ncode=1, codes=0x0, res=...) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:908
    k=1) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:1242
    at /home/user/source2/faiss/faiss/IndexIVF.cpp:448

faiss/faiss/IndexIVF.cpp
561├───────────────────> nheap += scanner->scan_codes(
 562│                             list_size, codes, ids, simi, idxi, k);  // codes is empty. not alloc any memmory.
 563│
 564│                     return list_size;
 565│                 }
 566│             } catch (const std::exception& e) {
 567│                 std::lock_guard<std::mutex> lock(exception_mutex);
 568│                 exception_string =
 569│                         demangle_cpp_symbol(typeid(e).name()) + "  " + e.what();
 570│                 interrupt = true;
 571│                 return size_t(0);
 572│             }
 573│         };
 574│

 facebookresearch#5  0x0000000000411d96 in operator() (__closure=0x7fffffffa5c0, key=0, coarse_dis_i=11.6475525, simi=0x584510, idxi=0x5844f0, list_size_max=9223372036854775807) at /home/user/source2/faiss/faiss/IndexIVF.cpp:561
yuhaijun999 pushed a commit to yuhaijun999/faiss that referenced this pull request Oct 25, 2023
… ==0 and then search. crash.

for example:

int d = 64; // dimension;
    int nb = 1; // database size
    int nq = 1; // nb of queries

    std::mt19937 rng;
    std::uniform_real_distribution<> distrib;

    float* xb = new float[d * nb];
    float* xq = new float[d * nq];

    for (int i = 0; i < nb; i++) {
        for (int j = 0; j < d; j++)
            xb[d * i + j] = distrib(rng);
        xb[d * i] += i / 1000.;
    }

    for (int i = 0; i < nq; i++) {
        for (int j = 0; j < d; j++)
            xq[d * i + j] = distrib(rng);
        xq[d * i] += i / 1000.;
    }

    int nlist = 1;
    int k = 1;
    int m = 8;
    size_t nbits_per_idx = 0;
    faiss::IndexFlatL2 quantizer(d);
    faiss::IndexIVFPQ index(&quantizer, d, nlist, m, nbits_per_idx);

    index.train(nb, xb);
    index.add(nb, xb);

    { // with param
        int query_count = 1;
        // sanity check
        idx_t* I = new idx_t[k * query_count];
        float* D = new float[k * query_count];

        index.search(query_count, xq, k, D, I);  // crash. Segmentation fault (core dumped)

        printf("I=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%5zd ", I[i * k + j]);
            printf("\n");
        }

        printf("D=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%7g ", D[i * k + j]);
            printf("\n");
        }

        delete[] I;
        delete[] D;
    }

./14-IVFPQ_crash
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
Segmentation fault (core dumped)

faiss/faiss/impl/ProductQuantizer-inl.h
 72│ inline uint64_t PQDecoderGeneric::decode() {
 73│     if (offset == 0) {
 74├───────> reg = *code;
 75│     }
 76│     uint64_t c = (reg >> offset);
 77│
 78│     if (offset + nbits >= 8) {
 79│         uint64_t e = 8 - offset;
 80│         ++code;
 81│         for (int i = 0; i < (nbits - (8 - offset)) / 8; ++i) {
 82│             c |= ((uint64_t)(*code++) << e);
 83│             e += 8;
 84│         }
 85│
 86│         offset += nbits;
 87│         offset &= 7;

 (gdb) bt
    ncode=1, codes=0x0, res=...) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:908
    k=1) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:1242
    at /home/user/source2/faiss/faiss/IndexIVF.cpp:448

faiss/faiss/IndexIVF.cpp
561├───────────────────> nheap += scanner->scan_codes(
 562│                             list_size, codes, ids, simi, idxi, k);  // codes is empty. not alloc any memmory.
 563│
 564│                     return list_size;
 565│                 }
 566│             } catch (const std::exception& e) {
 567│                 std::lock_guard<std::mutex> lock(exception_mutex);
 568│                 exception_string =
 569│                         demangle_cpp_symbol(typeid(e).name()) + "  " + e.what();
 570│                 interrupt = true;
 571│                 return size_t(0);
 572│             }
 573│         };
 574│

 facebookresearch#5  0x0000000000411d96 in operator() (__closure=0x7fffffffa5c0, key=0, coarse_dis_i=11.6475525, simi=0x584510, idxi=0x5844f0, list_size_max=9223372036854775807) at /home/user/source2/faiss/faiss/IndexIVF.cpp:561
yuhaijun999 pushed a commit to yuhaijun999/faiss that referenced this pull request Jan 22, 2024
… ==0 and then search. crash.

for example:

int d = 64; // dimension;
    int nb = 1; // database size
    int nq = 1; // nb of queries

    std::mt19937 rng;
    std::uniform_real_distribution<> distrib;

    float* xb = new float[d * nb];
    float* xq = new float[d * nq];

    for (int i = 0; i < nb; i++) {
        for (int j = 0; j < d; j++)
            xb[d * i + j] = distrib(rng);
        xb[d * i] += i / 1000.;
    }

    for (int i = 0; i < nq; i++) {
        for (int j = 0; j < d; j++)
            xq[d * i + j] = distrib(rng);
        xq[d * i] += i / 1000.;
    }

    int nlist = 1;
    int k = 1;
    int m = 8;
    size_t nbits_per_idx = 0;
    faiss::IndexFlatL2 quantizer(d);
    faiss::IndexIVFPQ index(&quantizer, d, nlist, m, nbits_per_idx);

    index.train(nb, xb);
    index.add(nb, xb);

    { // with param
        int query_count = 1;
        // sanity check
        idx_t* I = new idx_t[k * query_count];
        float* D = new float[k * query_count];

        index.search(query_count, xq, k, D, I);  // crash. Segmentation fault (core dumped)

        printf("I=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%5zd ", I[i * k + j]);
            printf("\n");
        }

        printf("D=\n");
        for (int i = 0; i < query_count; i++) {
            for (int j = 0; j < k; j++)
                printf("%7g ", D[i * k + j]);
            printf("\n");
        }

        delete[] I;
        delete[] D;
    }

./14-IVFPQ_crash
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
WARNING clustering 1 points to 1 centroids: please provide at least 39 training points
Segmentation fault (core dumped)

faiss/faiss/impl/ProductQuantizer-inl.h
 72│ inline uint64_t PQDecoderGeneric::decode() {
 73│     if (offset == 0) {
 74├───────> reg = *code;
 75│     }
 76│     uint64_t c = (reg >> offset);
 77│
 78│     if (offset + nbits >= 8) {
 79│         uint64_t e = 8 - offset;
 80│         ++code;
 81│         for (int i = 0; i < (nbits - (8 - offset)) / 8; ++i) {
 82│             c |= ((uint64_t)(*code++) << e);
 83│             e += 8;
 84│         }
 85│
 86│         offset += nbits;
 87│         offset &= 7;

 (gdb) bt
    ncode=1, codes=0x0, res=...) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:908
    k=1) at /home/user/source2/faiss/faiss/IndexIVFPQ.cpp:1242
    at /home/user/source2/faiss/faiss/IndexIVF.cpp:448

faiss/faiss/IndexIVF.cpp
561├───────────────────> nheap += scanner->scan_codes(
 562│                             list_size, codes, ids, simi, idxi, k);  // codes is empty. not alloc any memmory.
 563│
 564│                     return list_size;
 565│                 }
 566│             } catch (const std::exception& e) {
 567│                 std::lock_guard<std::mutex> lock(exception_mutex);
 568│                 exception_string =
 569│                         demangle_cpp_symbol(typeid(e).name()) + "  " + e.what();
 570│                 interrupt = true;
 571│                 return size_t(0);
 572│             }
 573│         };
 574│

 facebookresearch#5  0x0000000000411d96 in operator() (__closure=0x7fffffffa5c0, key=0, coarse_dis_i=11.6475525, simi=0x584510, idxi=0x5844f0, list_size_max=9223372036854775807) at /home/user/source2/faiss/faiss/IndexIVF.cpp:561
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants