Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft — depends on #2909. This branch still has 4 FP16 regression failures from int32 data narrowing; the same tests pass with #2909 applied.
The PyTorch
cumprodconverter ignores explicitdtype. For[1.9, 2.2, 3.2]withdtype=torch.int32, PyTorch casts the input first and returns[1, 2, 6]. The converter instead multiplies the original floating-point values.Changes
dtypefrom positional inputs or keyword arguments and cast before the gather/scatter loop, including for a length-one axis.Testing
Local Core ML CPU prediction with Torch 2.8, TorchScript/TorchExport, FP32/FP16 compute, and an iOS17 target:
dtype=None, input dtypes, downstream consumers, and unsupported dtypes. The initial test set produces 48 failures and 14 passes before the converter fix.The 4 remaining failures are
[200, 200, 2]and[256, 256, 1]on both frontends with FP16 compute. An int32 prefix product is narrowed before the next gather. Both examples remain as regression tests; this PR stays in draft until #2909 is incorporated and the branch is revalidated.Existing FP16 accumulation rounding differences remain. No performance benchmark or full project test run was performed; remote CI has no results yet.