d-smirnov commented on code in PR #10189:
URL: https://github.com/apache/tvm/pull/10189#discussion_r894355603
##########
tests/python/relay/aot/test_cpp_aot.py:
##########
@@ -117,8 +117,8 @@ def @main(%data : Tensor[(1, 3, 64, 64), uint8], %weight :
Tensor[(3, 3, 5, 5),
mod = tvm.relay.build(
ir_mod,
params=params,
- target="c",
- executor=backend.Executor("aot", {"interface-api": "packed"}),
+ target="c --link-params=1",
Review Comment:
This led to substitution of the executor from AOT to Graph. Removed now
##########
tests/python/relay/aot/test_crt_aot_usmp.py:
##########
@@ -58,22 +58,72 @@ def check_for_no_tvm_backendallocworkspace_calls(mod:
tvm.runtime.module):
) == 0, "This is failing because USMP was unable to plan for every
tir.allocate node"
+# U1 test case
+@parametrize_aot_options
+def test_synthetic(interface_api, use_unpacked_api, test_runner):
+ mod, params = tvm.relay.testing.synthetic.get_workload()
+ main_func = mod["main"]
+ shape_dict = {p.name_hint: p.checked_type.concrete_shape for p in
main_func.params}
+ type_dict = {p.name_hint: p.checked_type.dtype for p in main_func.params}
+
+ input_data = np.ones(shape_dict["data"]).astype(type_dict["data"])
+ params = {}
+ for name, shape in shape_dict.items():
+ if name != "data":
+ params[name] = np.ones(shape_dict[name]).astype(type_dict[name])
+
+ inputs = {"data": input_data}
+ output_list = generate_ref_data(mod, inputs, params)
+ config = (
+ {
+ "tir.disable_vectorize": True,
+ "tir.disable_storage_rewrite": True,
+ "tir.usmp.enable": True,
+ "tir.usmp.algorithm": "greedy_by_conflicts",
+ },
+ )
+
+ pass_config = {"tir.usmp.enable": True}
+ test_runner = AOTTestRunner(
+ makefile=test_runner.makefile,
+ prologue=test_runner.prologue,
+ epilogue=test_runner.epilogue,
+ includes=test_runner.includes,
+ parameters=test_runner.parameters,
+ pass_config={**test_runner.pass_config},
+ )
+ test_runner.pass_config.update(*config)
+ compile_and_run(
+ AOTTestModel(module=mod, inputs=inputs, outputs=output_list,
params=params),
+ test_runner,
+ interface_api,
+ use_unpacked_api,
+ )
+
+
@pytest.mark.parametrize(
- "workspace_byte_alignment,main_workspace_size",
+ "workspace_byte_alignment,constant_byte_alignment,main_workspace_size",
[
- (8, 17280),
- (16, 17280),
- (256, 17792),
+ (8, 8, 18228),
+ (16, 8, 18228),
+ (256, 8, 18740),
+ (8, 16, 18236),
+ (16, 16, 18236),
+ (256, 16, 18748),
+ (8, 256, 19084),
+ (16, 256, 19084),
+ (256, 256, 19596),
],
)
-def test_memory_planning(workspace_byte_alignment, main_workspace_size):
+def test_memory_planning(workspace_byte_alignment, constant_byte_alignment,
main_workspace_size):
Review Comment:
amended
--
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]