-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from JiacongSun/master
Merging ZigZag-IMC repository into ZigZag repository
- Loading branch information
Showing
40 changed files
with
18,267 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pytest | ||
|
||
from zigzag.api import get_hardware_performance_zigzag_imc | ||
|
||
workloads = ( | ||
"zigzag/inputs/examples/workload/alexnet.onnx", | ||
"zigzag/inputs/examples/workload/mobilenetv2.onnx", | ||
"zigzag/inputs/examples/workload/resnet18.onnx", | ||
"zigzag.inputs.examples.workload.resnet18", | ||
) | ||
|
||
# Expected energy, latency (#cycles), clk time and area for each workload defined above | ||
ens_lats_clks_areas = { | ||
"zigzag/inputs/examples/workload/alexnet.onnx": (2557076250.266322, 44012016.0, 6.61184, 0.7892517658006044), | ||
"zigzag/inputs/examples/workload/mobilenetv2.onnx": (802185102.578702, 14939020.0, 6.61184, 0.7892517658006044), | ||
"zigzag/inputs/examples/workload/resnet18.onnx": (2252151728.145326, 62079022.0, 6.61184, 0.7892517658006044), | ||
"zigzag.inputs.examples.workload.resnet18": (2466090000.2577806, 67309272.0, 6.61184, 0.7892517658006044), | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def mapping(): | ||
return "zigzag.inputs.examples.mapping.default_imc" | ||
|
||
|
||
@pytest.fixture | ||
def accelerator(): | ||
return "zigzag.inputs.examples.hardware.Aimc" | ||
|
||
|
||
@pytest.mark.parametrize("workload", workloads) | ||
def test_api(workload, accelerator, mapping): | ||
(energy, latency, tclk, area, cmes) = get_hardware_performance_zigzag_imc( | ||
workload, accelerator, mapping | ||
) | ||
(expected_energy, expected_latency, expected_tclk, expected_area) = ens_lats_clks_areas[workload] | ||
assert energy == pytest.approx(expected_energy) | ||
assert latency == pytest.approx(expected_latency) | ||
assert tclk == pytest.approx(expected_tclk) | ||
assert area == pytest.approx(expected_area) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pytest | ||
|
||
from zigzag.api import get_hardware_performance_zigzag_imc | ||
|
||
workloads = ( | ||
"zigzag/inputs/examples/workload/alexnet.onnx", | ||
"zigzag/inputs/examples/workload/mobilenetv2.onnx", | ||
"zigzag/inputs/examples/workload/resnet18.onnx", | ||
"zigzag.inputs.examples.workload.resnet18", | ||
) | ||
|
||
# Expected energy, latency (#cycles), clk time and area for each workload defined above | ||
ens_lats_clks_areas = { | ||
"zigzag/inputs/examples/workload/alexnet.onnx": (2340181787.2719307, 72692592.0, 3.2026, 0.785592664), | ||
"zigzag/inputs/examples/workload/mobilenetv2.onnx": (703506891.3687075, 28005964.0, 3.2026, 0.785592664), | ||
"zigzag/inputs/examples/workload/resnet18.onnx": (1828766840.9463186, 120700590.0, 3.2026, 0.785592664), | ||
"zigzag.inputs.examples.workload.resnet18": (2008581031.8287854, 130747736.0, 3.2026, 0.785592664), | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def mapping(): | ||
return "zigzag.inputs.examples.mapping.default_imc" | ||
|
||
|
||
@pytest.fixture | ||
def accelerator(): | ||
return "zigzag.inputs.examples.hardware.Dimc" | ||
|
||
|
||
@pytest.mark.parametrize("workload", workloads) | ||
def test_api(workload, accelerator, mapping): | ||
(energy, latency, tclk, area, cmes) = get_hardware_performance_zigzag_imc( | ||
workload, accelerator, mapping | ||
) | ||
(expected_energy, expected_latency, expected_tclk, expected_area) = ens_lats_clks_areas[workload] | ||
assert energy == pytest.approx(expected_energy) | ||
assert latency == pytest.approx(expected_latency) | ||
assert tclk == pytest.approx(expected_tclk) | ||
assert area == pytest.approx(expected_area) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.