Skip to content

Commit

Permalink
Merge pull request #1202 from fengyuentau:dnn/fix_cuda_matmul_crash
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Aug 16, 2024
2 parents 9d0d24d + c397223 commit 042dd81
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
Binary file added testdata/dnn/onnx/data/input_matmul_bcast.npy
Binary file not shown.
Binary file added testdata/dnn/onnx/data/output_matmul_bcast.npy
Binary file not shown.
10 changes: 10 additions & 0 deletions testdata/dnn/onnx/generate_onnx_models_with_onnxscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,13 @@ def clip_div_shared_constant(x: ost.FLOAT[1, 8, 12, 10]) -> ost.FLOAT[1, 8, 12,
clip = op.Clip(div, Constant_output_0, Constant_1_output_0)
return clip
make_model_and_data(clip_div_shared_constant, np.random.rand(1, 8, 12, 10).astype(np.float32))

''' Subgraph [Input] -> MatMul<B> -> [Outpunt]
'''

B = np.random.randn(16, 8).astype(np.float32)

@ost.script()
def matmul_bcast(x: ost.FLOAT[64, 1, 16]) -> ost.FLOAT[64, 1, 8]:
return op.MatMul(x, op.Constant(value=onnx.numpy_helper.from_array(B)))
make_model_and_data(matmul_bcast, np.random.randn(64, 1, 16).astype(np.float32))
Binary file added testdata/dnn/onnx/models/matmul_bcast.onnx
Binary file not shown.

0 comments on commit 042dd81

Please sign in to comment.