force selected pipeline stages in throughput mode
Validate Operations / validate-operations (push) Has been cancelled
Validate Operations / validate-operations (push) Has been cancelled
increase throughput scheduler budget add experimental throughput auto mode
This commit is contained in:
@@ -39,7 +39,7 @@ def main():
|
||||
out = root / source.stem / target
|
||||
out.mkdir(parents=True)
|
||||
result = subprocess.run([args.compiler, str(source), "-o", str(out / "model"),
|
||||
"--maccel=PIM", f"--{target}", "--pipeline=2", "--core-count=168",
|
||||
"--maccel=PIM", f"--{target}", "--pipeline=1", "--core-count=168",
|
||||
"--crossbar-count=96", "--crossbar-size=128", "--mlir-disable-threading", "--pim-dump-ir",
|
||||
f"--pim-target-config={REPO}/validation/pimsim_configs/pimcomp/arch-a/throughput_config_1000ms.json"],
|
||||
capture_output=True, text=True, timeout=30, env=dict(os.environ, OMP_NUM_THREADS="1"))
|
||||
@@ -50,13 +50,8 @@ def main():
|
||||
assert result.returncode == 0, output
|
||||
if target == "EmitPimCodegen":
|
||||
assert (out / "pim/config.json").exists()
|
||||
report = json.loads((out / "reports/pipeline_selection.json").read_text())
|
||||
assert report["generated_candidates"] == 1
|
||||
assert report["single_candidate_analysis_skipped"]
|
||||
assert report["lowered_candidates"] == 1
|
||||
assert "no cost comparison required" in report["reason"]
|
||||
assert not (out / "reports/pipeline_selection.json").exists()
|
||||
else:
|
||||
assert "intermediate emission retains the original schedule" in output
|
||||
assert not (out / "reports/pipeline_selection.json").exists()
|
||||
assert not (out / "reports/pipeline_periodic.json").exists()
|
||||
assert not (out / "pim").exists()
|
||||
@@ -71,13 +66,38 @@ def main():
|
||||
assert not (out / "dialects/pim1_buff.mlir").exists()
|
||||
else:
|
||||
assert "pim.core" in ir and "memref<" in ir
|
||||
weights = [helper.make_tensor(f"w{i}", TensorProto.FLOAT, [4, 4],
|
||||
[float(i + 1) if row == column else 0. for row in range(4) for column in range(4)])
|
||||
for i in range(2)]
|
||||
graph = helper.make_graph([helper.make_node("MatMul", ["x", "w0"], ["a"]),
|
||||
helper.make_node("MatMul", ["a", "w1"], ["z"])], "two-groups",
|
||||
[helper.make_tensor_value_info("x", TensorProto.FLOAT, [1, 4])],
|
||||
[helper.make_tensor_value_info("z", TensorProto.FLOAT, [1, 4])], initializer=weights)
|
||||
chain = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 18)])
|
||||
chain.ir_version = 10
|
||||
chain_path = root / "two-groups.onnx"
|
||||
onnx.save(chain, chain_path)
|
||||
for target in ("EmitSpatial", "EmitPim", "EmitPimBufferized", "EmitPimCodegen"):
|
||||
out = root / "two-groups" / target
|
||||
out.mkdir(parents=True)
|
||||
result = subprocess.run([args.compiler, str(chain_path), "-o", str(out / "model"),
|
||||
"--maccel=PIM", f"--{target}", "--pipeline=2", "--core-count=2",
|
||||
"--crossbar-count=1", "--crossbar-size=128", "--mlir-disable-threading"],
|
||||
capture_output=True, text=True, timeout=30)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
if target == "EmitPimCodegen":
|
||||
report = json.loads((out / "reports/pipeline_selection.json").read_text())
|
||||
assert report["generated_candidates"] == report["lowered_candidates"] == 1
|
||||
assert report["single_candidate_analysis_skipped"] and report["selected_depth"] == 2
|
||||
else:
|
||||
assert "intermediate emission retains the original schedule" in result.stdout + result.stderr
|
||||
assert not (out / "pim").exists()
|
||||
out = root / "explicit-diagnostic"
|
||||
out.mkdir()
|
||||
result = subprocess.run([args.compiler, str(small), "-o", str(out / "model"),
|
||||
"--maccel=PIM", "--EmitSpatial", "--pipeline=2", "--core-count=168",
|
||||
"--crossbar-count=96", "--crossbar-size=128", "--mlir-disable-threading",
|
||||
"--pim-periodic-diagnostics",
|
||||
f"--pim-target-config={REPO}/validation/pimsim_configs/pimcomp/arch-a/throughput_config_1000ms.json"],
|
||||
result = subprocess.run([args.compiler, str(chain_path), "-o", str(out / "model"),
|
||||
"--maccel=PIM", "--EmitSpatial", "--pipeline=2", "--core-count=2",
|
||||
"--crossbar-count=1", "--crossbar-size=128", "--mlir-disable-threading",
|
||||
"--pim-periodic-diagnostics"],
|
||||
capture_output=True, text=True, timeout=30)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
assert (out / "reports/pipeline_periodic.json").exists()
|
||||
|
||||
Reference in New Issue
Block a user