Commit 193f8780 authored by MaHang's avatar MaHang
Browse files

根据review意见修改

parent dd101970
...@@ -46,9 +46,9 @@ std::shared_ptr<infiniop_test::Result> Test::run( ...@@ -46,9 +46,9 @@ std::shared_ptr<infiniop_test::Result> Test::run(
b->desc()), b->desc()),
return TEST_FAILED(OP_CREATION_FAILED, "Failed to create op descriptor.")); return TEST_FAILED(OP_CREATION_FAILED, "Failed to create op descriptor."));
CHECK_OR(infiniopSwiGLU(op_desc, c->data(), a->data(), b->data(), nullptr), CHECK_OR(infiniopSwiGLU(op_desc, c->data(), a->data(), b->data(), nullptr),
return TEST_FAILED(OP_CREATION_FAILED, "Failed to create op descriptor.")); return TEST_FAILED(OP_CREATION_FAILED, "Failed during execution."));
try { try {
allClose(c, _attributes->ans); allClose(c, _attributes->ans, _rtol, _atol);
} catch (const std::exception &e) { } catch (const std::exception &e) {
return TEST_FAILED(RESULT_INCORRECT, e.what()); return TEST_FAILED(RESULT_INCORRECT, e.what());
} }
...@@ -63,7 +63,7 @@ std::shared_ptr<infiniop_test::Result> Test::run( ...@@ -63,7 +63,7 @@ std::shared_ptr<infiniop_test::Result> Test::run(
b->data(), b->data(),
nullptr); nullptr);
}, },
(warm_ups + 1) / 2, (iterations + 1) / 2); warm_ups, iterations);
return TEST_PASSED(elapsed_time); return TEST_PASSED(elapsed_time);
} }
......
from ast import List
import numpy as np import numpy as np
import gguf import gguf
from typing import List from typing import List
...@@ -53,7 +52,6 @@ class SwiGLUTestCase(InfiniopTestCase): ...@@ -53,7 +52,6 @@ class SwiGLUTestCase(InfiniopTestCase):
ans = swiglu( ans = swiglu(
self.a.astype(np.float64), self.a.astype(np.float64),
self.b.astype(np.float64), self.b.astype(np.float64),
# None,
) )
test_writer.add_tensor( test_writer.add_tensor(
test_writer.gguf_key("ans"), ans, raw_dtype=gguf.GGMLQuantizationType.F64 test_writer.gguf_key("ans"), ans, raw_dtype=gguf.GGMLQuantizationType.F64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment