Skip to content

Commit

Permalink
Add support for 3d convolution
Browse files Browse the repository at this point in the history
  • Loading branch information
dmenig committed Sep 18, 2023
1 parent 02fe4b5 commit 93c77c1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DxDispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ if(DXD_TESTS)
set_tests_properties(test_${model_name} PROPERTIES PASS_REGULAR_EXPRESSION ${expected_output})
endfunction()

model_test(dml_convolution "Resource 'output': 6, 8, 12, 14")
model_test(dml_convolution_2d "Resource 'output': 6, 8, 12, 14")
model_test(dml_convolution_3d "Resource 'output': 4, 4, 4, 4, 4, 4, 4, 4")
model_test(dml_cumulative_product "Resource 'Out': 2, 8, 64, 192")
model_test(dml_element_wise_add "Resource 'Out': 6, 10, -2")
model_test(dml_element_wise_add_npy "Resource 'Out': 2, 4, 6, 8, 10, 12")
Expand Down
File renamed without changes.
60 changes: 60 additions & 0 deletions DxDispatch/models/dml_convolution_3d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "./_schema.json",

"resources":
{
"input":
{
"initialValuesDataType": "FLOAT32",
"initialValues": { "valueCount": 27, "valueStart": 1, "valueDelta": 0 }
},
"filter":
{
"initialValuesDataType": "FLOAT32",
"initialValues": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
},
"output":
{
"initialValuesDataType": "FLOAT32",
"initialValues": { "valueCount": 4, "value": 0 }
}
},

"dispatchables":
{
"conv3d":
{
"type": "DML_OPERATOR_CONVOLUTION",
"desc":
{
"InputTensor": { "DataType": "FLOAT32", "Sizes": [1,1,3,3,3] },
"FilterTensor": { "DataType": "FLOAT32", "Sizes": [1,1,2,2,2] },
"OutputTensor": { "DataType": "FLOAT32", "Sizes": [1,1,2,2,2] },
"Mode": "DML_CONVOLUTION_MODE_CROSS_CORRELATION",
"Direction": "DML_CONVOLUTION_DIRECTION_FORWARD",
"DimensionCount": 3,
"Strides": [1,1,1],
"Dilations": [1,1,1],
"StartPadding": [0,0,0],
"EndPadding": [0,0,0],
"OutputPadding": [0,0,0],
"GroupCount": 1
}
}
},

"commands":
[
{
"type": "dispatch",
"dispatchable": "conv3d",
"bindings":
{
"InputTensor": "input",
"FilterTensor": "filter",
"OutputTensor": "output"
}
},
{ "type": "print", "resource": "output" }
]
}

0 comments on commit 93c77c1

Please sign in to comment.