comaniac commented on a change in pull request #8815:
URL: https://github.com/apache/tvm/pull/8815#discussion_r694273401
##########
File path: tests/python/contrib/test_vitis_ai/infrastructure.py
##########
@@ -85,6 +85,7 @@ def build_module(
):
if enable_vitis_ai:
mod = partition_for_vitis_ai(mod, params, dpu_target)
+ print(mod)
Review comment:
Remove print.
##########
File path: docker/Dockerfile.demo_vitis_ai
##########
@@ -16,7 +16,7 @@
# under the License.
# CI docker VAI env
-FROM xilinx/vitis-ai:latest
+FROM xilinx/vitis-ai:1.4.916
Review comment:
I think you also need to put this change (and other docker related
changes) to #8814? Otherwise this PR won't be able to use the latest image
anyways.
##########
File path: tests/python/contrib/test_vitis_ai/test_vitis_ai_codegen.py
##########
@@ -46,19 +50,22 @@ def set_func_attr(func, compile_name, symbol_name):
def test_conv2d():
- """Test conv2d operator for Vitis-AI DPUCADX8G and DPUCZDX8G-zcu104
targets"""
+ """Test conv2d operator for Vitis AI DPU targets"""
x = relay.var("x", shape=(1, 3, 224, 224))
w = relay.const(np.zeros((16, 3, 3, 3), dtype="float32"))
y = relay.nn.conv2d(x, w, strides=[2, 2], padding=[1, 1, 1, 1],
kernel_size=[3, 3])
func = relay.Function([x], y)
params = {}
- params["x"] = np.zeros((1, 3, 224, 224), dtype="float32")
params["w"] = np.random.rand(16, 3, 3, 3).astype("float32")
mod = tvm.IRModule()
mod["main"] = func
- verify_codegen(mod, params=params, dpu_target="DPUCADX8G")
- verify_codegen(mod, params=params, dpu_target="DPUCZDX8G-zcu104")
+ verify_codegen(mod, params=params, dpu_target="DPUCADF8H", tvm_ops=2)
Review comment:
Consider using parameterized test:
```python
@pytest.mark.parametrize("target", ["DPUCADF8H", ....])
def test_conv2d():
```
And change the bottom to be
```python
if __name__ == "__main__":
if sys.platform == "win32":
print("Skip test on Windows for now")
sys.exit(0)
pytest.main([__file__])
```
##########
File path: tests/python/contrib/test_vitis_ai/test_vitis_ai_codegen.py
##########
@@ -46,19 +50,22 @@ def set_func_attr(func, compile_name, symbol_name):
def test_conv2d():
- """Test conv2d operator for Vitis-AI DPUCADX8G and DPUCZDX8G-zcu104
targets"""
+ """Test conv2d operator for Vitis AI DPU targets"""
x = relay.var("x", shape=(1, 3, 224, 224))
w = relay.const(np.zeros((16, 3, 3, 3), dtype="float32"))
y = relay.nn.conv2d(x, w, strides=[2, 2], padding=[1, 1, 1, 1],
kernel_size=[3, 3])
func = relay.Function([x], y)
params = {}
- params["x"] = np.zeros((1, 3, 224, 224), dtype="float32")
params["w"] = np.random.rand(16, 3, 3, 3).astype("float32")
mod = tvm.IRModule()
mod["main"] = func
- verify_codegen(mod, params=params, dpu_target="DPUCADX8G")
- verify_codegen(mod, params=params, dpu_target="DPUCZDX8G-zcu104")
+ verify_codegen(mod, params=params, dpu_target="DPUCADF8H", tvm_ops=2)
Review comment:
You can consider using parameterized tests:
```python
@pytest.mark.parametrize("target", ["DPUCADF8H", ....])
def test_conv2d():
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]