diff options
author | John Balis <phobossystems@gmail.com> | 2024-01-29 06:37:33 -0600 |
---|---|---|
committer | Georgi Gerganov <ggerganov@gmail.com> | 2024-01-30 16:20:25 +0200 |
commit | 625a699b5456994bc32a8093d53818f60ceda6d1 (patch) | |
tree | a2803e2bd4787418016e906886c2266d6b45293c /tests/test-backend-ops.cpp | |
parent | a4b07c057a553b1ac253051efc3f040351e2eae1 (diff) |
`ggml_cuda_cpy` support for 4d tensors and float16->float32 upcasting (ggml/686)
* added cuda float16->float32 upcasting to ggml_cuda_cpy
* added ability to copy 4d tensors with the cuda backend
* added tests for float16_>float32 upcast and 4d tensor cuda copys
* added 4d copy test for float32->float16 copy
* applied patch suggested by @iamlemec
* simplify cpy tests
---------
Co-authored-by: slaren <slarengh@gmail.com>
Diffstat (limited to 'tests/test-backend-ops.cpp')
-rw-r--r-- | tests/test-backend-ops.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index b328b19b..1d29070b 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -1927,8 +1927,10 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op test_cases.emplace_back(new test_dup(GGML_TYPE_I16, {10, 8, 3, 1}, {0, 2, 1, 3})); test_cases.emplace_back(new test_dup(GGML_TYPE_I16, {10, 8, 3, 1}, {1, 2, 0, 3})); - for (ggml_type type : all_types) { - test_cases.emplace_back(new test_cpy(GGML_TYPE_F32, type, {256, 10, 10, 1})); + for (ggml_type type_src : {GGML_TYPE_F16, GGML_TYPE_F32}) { + for (ggml_type type_dst : all_types) { + test_cases.emplace_back(new test_cpy(type_src, type_dst, {256, 4, 4, 4})); + } } test_cases.emplace_back(new test_cont()); |