Skip to content

Commit 6f8194f

Browse files
authored
NXP backend: update eIQ Neutron SDK to 3.2.0 (pytorch#21438)
### Summary Upgrade the eIQ Neutron SDK to v3.2.0 with backward compatibility. ### Test plan Tests can be manually run using pytest -c /dev/null backends/nxp/tests/ cc @robert-kalmar @JakeStevens @digantdesai @rascani
1 parent a1d4d35 commit 6f8194f

5 files changed

Lines changed: 33 additions & 9 deletions

File tree

‎backends/nxp/backend/neutron_target_spec.py‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,40 @@ def get_name(self) -> str:
122122

123123
# Whether the target has subsystem (Neutron-S) or not (Neutron-C).
124124
def is_subsystem(self) -> bool:
125-
return self.neutron_target.subsystem
125+
return (
126+
self.neutron_target.npu.subsystem
127+
if hasattr(self.neutron_target, "npu")
128+
else self.neutron_target.subsystem
129+
)
126130

127131
# Number of compute units.
128132
def get_num_units(self) -> int:
129-
return self.neutron_target.numUnits
133+
return (
134+
self.neutron_target.npu.numUnits
135+
if hasattr(self.neutron_target, "npu")
136+
else self.neutron_target.numUnits
137+
)
130138

131139
# Number of compute pipelines.
132140
def get_num_pipes(self) -> int:
133-
return self.neutron_target.numPipes
141+
return (
142+
self.neutron_target.npu.numPipes
143+
if hasattr(self.neutron_target, "npu")
144+
else self.neutron_target.numPipes
145+
)
134146

135147
# Number of compute MACs.
136148
def get_num_macs(self) -> int:
137-
return self.neutron_target.numMacs
149+
return (
150+
self.neutron_target.npu.numMacs
151+
if hasattr(self.neutron_target, "npu")
152+
else self.neutron_target.numMacs
153+
)
138154

139155
# Neutron compute block hardware version.
140156
def get_hw_version(self) -> NeutronHWVersion:
141-
return NeutronHWVersion(self.neutron_target.hwVersion)
157+
return NeutronHWVersion(
158+
self.neutron_target.npu.hwVersion
159+
if hasattr(self.neutron_target, "npu")
160+
else self.neutron_target.hwVersion
161+
)

‎backends/nxp/requirements-eiq.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--index-url https://eiq.nxp.com/repository
2-
eiq-neutron-sdk==3.1.3
2+
eiq-neutron-sdk==3.2.0
33
eiq_nsys

‎backends/nxp/tests/ir/converter/node_converter/test_conv_converter.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,10 @@ def test__fwd_impl_b(self, input_shape, out_channels, use_qat, mocker, request):
757757
s := 1,
758758
d := 1,
759759
id=f"bounds of kernel height: {_conv_id(ins, oc, ks=ks, s=s, d=d)}",
760+
marks=pytest.mark.xfail(
761+
reason="AIR-14679",
762+
strict=True,
763+
),
760764
),
761765
pytest.param(
762766
ins := (4, 3, 3, 8500),

‎docs/source/backends/nxp/nxp-overview.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Among currently supported machine learning models are:
2424

2525
- [MCUXpresso IDE](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE) or [MCUXpresso Visual Studio Code extension](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC)
2626
- [MCUXpresso SDK 26.06](https://mcuxpresso.nxp.com/mcuxsdk/26.06.00/html/index.html)
27-
- eIQ Neutron SDK version 3.1.3, what you can download from eIQ PyPI:
27+
- eIQ Neutron SDK version 3.2.0, what you can download from eIQ PyPI:
2828

2929
```commandline
30-
$ pip install --index-url https://eiq.nxp.com/repository eiq-neutron-sdk==3.1.3
30+
$ pip install --index-url https://eiq.nxp.com/repository eiq-neutron-sdk==3.2.0
3131
```
3232

3333
Instead of manually installing requirements, except MCUXpresso IDE and SDK, you can use the setup script:

‎examples/nxp/setup.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -u
88
EIQ_PYPI_URL="${EIQ_PYPI_URL:-https://eiq.nxp.com/repository}"
99

1010
# Install eIQ Neutron dependencies - SDK and simulator
11-
pip install --index-url ${EIQ_PYPI_URL} eiq-neutron-sdk==3.1.3 eiq_nsys
11+
pip install --index-url ${EIQ_PYPI_URL} eiq-neutron-sdk==3.2.0 eiq_nsys
1212

1313
# Get the directory of the current script
1414
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

0 commit comments

Comments
 (0)