-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial CUDA native UT * fix the build issue * fix other build error * add 30 mins to android packaging pipeline timeout due to early timing out * undo android pipeline timeout change - move to other PR * revert ifdef for testing ci * add if def for cuda * update ci ORT linux package name * update the package extraction path * Update ci.yml * Update ci.yml --------- Co-authored-by: Sayan Shaw <[email protected]> Co-authored-by: Wenbing Li <[email protected]> Co-authored-by: Wenbing Li <[email protected]>
- Loading branch information
1 parent
a32b932
commit a03eded
Showing
7 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include <filesystem> | ||
#include <locale> | ||
#include "gtest/gtest.h" | ||
#include "ocos.h" | ||
#include "test_kernel.hpp" | ||
|
||
#ifdef USE_CUDA | ||
|
||
TEST(CudaOp, test_fastgelu) { | ||
auto ort_env = std::make_unique<Ort::Env>(ORT_LOGGING_LEVEL_WARNING, "Default"); | ||
|
||
std::vector<TestValue> inputs(2); | ||
inputs[0].name = "x"; | ||
inputs[0].element_type = ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; | ||
inputs[0].dims = {6}; | ||
inputs[0].values_float = {0., 1., 2., 3., 4., 5.}; | ||
|
||
inputs[1].name = "bias"; | ||
inputs[1].element_type = ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; | ||
inputs[1].dims = {6}; | ||
inputs[1].values_float = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5}; | ||
|
||
std::vector<TestValue> outputs(1); | ||
outputs[0].name = "y"; | ||
outputs[0].element_type = ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; | ||
outputs[0].dims = {6}; | ||
outputs[0].values_float = {0., 0.9505811, 2.1696784, 3.298689, 4.399991, 5.5}; | ||
|
||
std::filesystem::path model_path = "data/cuda"; | ||
model_path /= "test_fastgelu.onnx"; | ||
|
||
TestInference(*ort_env, model_path.c_str(), inputs, outputs); | ||
} | ||
|
||
#endif |