-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fail to find a function wehn build unit-test #1413
Comments
这个是因为你要考虑cpu stub啊。stub/hl_matrix_stub.h inline int hl_matrix_classification_error(Elem_t* topVal, int ldv,
int* topIds,
Elem_t* src, int lds,
int dim,
int topkSize,
int numSamples,
int* label,
Elem_t* recResult) {
return HPPL_RET_OK;
}
|
可以考虑加一些单测: test_matrixCompare.cpp void testMatrixClassificationError(int samples, int dim, int beamSize) {
MatrixPtr cpuOut = std::make_shared<CpuMatrix>(samples, 1);
MatrixPtr gpuOut = std::make_shared<GpuMatrix>(samples, 1);
MatrixPtr cpuSrc = std::make_shared<CpuMatrix>(samples, dim);
MatrixPtr gpuSrc = std::make_shared<GpuMatrix>(samples, dim);
IVectorPtr cpuLbl = std::make_shared<CpuIVector>(samples);
IVectorPtr gpuLbl = std::make_shared<GpuIVector>(samples);
cpuSrc->randomizeUniform();
gpuSrc->copyFrom(*cpuSrc);
int* labels = cpuLbl->getData();
for (int i = 0; i < samples; ++i) {
labels[i] = (int)rand() % dim;
CHECK_LT(labels[i], dim);
}
gpuLbl->copyFrom(*cpuLbl);
cpuOut->classificationError(cpuSrc, cpuLbl, beamSize);
gpuOut->classificationError(gpuSrc, gpuLbl, beamSize);
MatrixPtr gpuRes = std::make_shared<CpuMatrix>(samples, 1);
gpuRes->copyFrom(*gpuOut);
MatrixCheckEqual(*gpuRes, *cpuOut);
}
TEST(Matrix, classificationError) {
for (auto samples : {1, 5, 31, 90, 150, 300}) {
for (auto dim : {1, 5, 8, 10, 15, 64, 80, 120, 256, 300,
1280, 5120, 50000}) {
for (auto beamSize : {1, 5, 10, 20, 40, (int)rand() % dim + 1}) {
if (beamSize > dim ) continue;
VLOG(3) << " sample= " << samples
<< " beamSize= " << beamSize
<< " dim= " << dim;
testMatrixClassificationError(samples, dim, beamSize);
}
}
}
} |
#892 (comment) 第三条。 |
Got it. Thanks. |
lizexu123
pushed a commit
to lizexu123/Paddle
that referenced
this issue
Feb 23, 2024
zhangyuqin1998
pushed a commit
to zhangyuqin1998/Paddle
that referenced
this issue
Feb 20, 2025
* Add support for mixed 4-bit/8-bit data types GEMM * fix ( and ) --------- Co-authored-by: Aleksandar Samardžić <[email protected]> Co-authored-by: Haicheng Wu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #1337, I got error messages from Travis CI as follows. This error doesn't appear in my local build. Could you please help me?
The text was updated successfully, but these errors were encountered: