Repository navigation
compiler: Misc dtype lowering tweaks - #3090
Open
FabioLuporini wants to merge 3 commits into
Open
FabioLuporini wants to merge 3 commits into
FabioLuporini wants to merge 3 commits into
Conversation
Infer vector result types from operands, initialize each component, and reuse only type-compatible reduction accumulators. Preserve scalar precision queries for compiler metadata and FD weights.
FabioLuporini
commented
Oct 24, 2026
| values = p._arg_values(estimate_memory=estimate_memory, **kwargs) | ||
| # A replacement may supply defaults for other arguments, such as | ||
| # a ConditionalDimension's factor. Explicit overrides take precedence | ||
| args.update({k: v for k, v in values.items() |
Contributor
Author
There was a problem hiding this comment.
this is gonna get dropped
mloubout
reviewed
Oct 24, 2026
| for p in overrides: | ||
| args.update(p._arg_values(estimate_memory=estimate_memory, **kwargs)) | ||
| values = p._arg_values(estimate_memory=estimate_memory, **kwargs) | ||
| # A replacement may supply defaults for other arguments, such as |
Contributor
There was a problem hiding this comment.
this looks like a bug in _arg_values
| if not dtypes or not np.issubdtype(base, np.complexfloating): | ||
| dtypes.update({base} - {None}) | ||
|
|
||
| dtypes = {dtypes_vector_mapper.get_base_dtype(i, i) for i in dtypes} |
Contributor
There was a problem hiding this comment.
second place it's like that, why not move it inside infer_dtype?
| return max(dtypes, key=lambda i: np.dtype(i).itemsize, default=None) | ||
| dtype = max(dtypes, key=lambda i: np.dtype(i).itemsize, default=None) | ||
|
|
||
| return dtypes_vector_mapper[dtype, n] if n > 1 else dtype |
Contributor
There was a problem hiding this comment.
likely need .get for safety?
| Extract the result dtype, retaining typed vector operands such as float2. | ||
| """ | ||
| # Arithmetic nodes may expose only their Functions' scalar precision | ||
| if not (expr.is_Add or expr.is_Mul or expr.is_Pow): |
Contributor
There was a problem hiding this comment.
so what does it leave? THis is an off check
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3090 +/- ##
==========================================
+ Coverage 84.29% 84.32% +0.03%
==========================================
Files 258 258
Lines 57460 57562 +102
Branches 4914 4920 +6
==========================================
+ Hits 48436 48542 +106
+ Misses 8202 8196 -6
- Partials 822 824 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
No description provided.