Skip to content

[EIEX-885] Add log support using new Neutron flow#20145

Open
irtrukhina wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:feature/EIEX-885-add-log-support-using-new-neutron-flow
Open

[EIEX-885] Add log support using new Neutron flow#20145
irtrukhina wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:feature/EIEX-885-add-log-support-using-new-neutron-flow

Conversation

@irtrukhina

@irtrukhina irtrukhina commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

NXP backend: Enable aten.log with new Neutron flow.

Test plan

Tests provided.

cc @robert-kalmar @JakeStevens @digantdesai @rascani

@pytorch-bot

pytorch-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20145

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Cancelled Job

As of commit 99747d3 with merge base 2759ef1 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 9, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@robert-kalmar robert-kalmar added module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate labels Jun 9, 2026
# Use 256 elements so that, after quantization to uint8, the input can
# cover the full discrete range [0, 255].
# The dataset is generated as a linear float ramp and later quantized,
# which effectively exercises all uint8 values.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: uint8 -> int8 (2 occurrences)

Comment on lines +34 to +59
class ConvBlocksWithLogModule(torch.nn.Module):
def __init__(self, conv_in_channels: int = 3):
super().__init__()
self.block1 = torch.nn.Sequential(
torch.nn.Conv2d(
in_channels=conv_in_channels,
out_channels=3,
kernel_size=(2, 2),
stride=(2, 2),
),
torch.nn.ReLU(),
)
self.block2 = torch.nn.Sequential(
torch.nn.Conv2d(
in_channels=conv_in_channels,
out_channels=10,
kernel_size=(2, 2),
stride=(2, 2),
),
torch.nn.ReLU(),
)

def forward(self, x):
x = self.block1(x)
x = x.clamp_min(1e-6).log()
return self.block2(x)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change needed here, but such a complex test model is counterproductive. We prefer simple models (1 to 3 ops at most) which focus on some specific case as efficiently as possible. Here fore example, the Relu, Clamp and Relu have no effect on the testing conditions, but they make the test more complex and on lines 88-89, the test may require changes if the support for the related ops is modified (e.g. Vasek's Conv PR is merged).

return self.block2(x)


class TestLog:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test using QAT. (All operators should have at least 1)

equal to `high`, with increments depending on the total number of elements.
"""

def __init__(self, num_samples=2, low=0.0, high=1.0):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Perhaps it would be more useful to have the default range include negative values (for example if we want to use this to test relu/prelu/...). How about -1 to 1?

dt.tofile(bin_file_name)


class LinearRampDatasetCreator(DatasetCreator):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea 👍🏻
Does this also work with the "int8 testing" added by @roman-janik-nxp last week?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants