Skip to content

First version of change fp type and MPFR support#1

Merged
ThrudPrimrose merged 16 commits into
mainfrom
elias/dev
Jun 18, 2026
Merged

First version of change fp type and MPFR support#1
ThrudPrimrose merged 16 commits into
mainfrom
elias/dev

Conversation

@eliasachermann

Copy link
Copy Markdown
Collaborator

No description provided.

@eliasachermann eliasachermann changed the title First version of chang fp type and MPFR support First version of change fp type and MPFR support Jun 1, 2026
from dace.sdfg import nodes, utils as sdfg_utils
from dace.sdfg.state import AbstractControlFlowRegion, SDFGState

_MAX_FIXPOINT_ITERS = 10

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.

I think you can write a pass that uses "FixePointIteration" to not need a hardcoded limit.
Check this: https://spcldace.readthedocs.io/en/latest/source/dace.transformation.html#dace.transformation.pass_pipeline.FixedPointPipeline

Maybe it makes sense to make this function into a pipeline/pass?

change_and_propagate_fp_types,
)

RULES = {

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.

This wouldn't work with float8 or bfloat16, what about using an algorithmic approach to use ctypes to ge tnumber of bits/bytes and return the type with more bytes/bits?

def change_and_propagate_fp_types(
sdfg: dace.SDFG,
initial_types: Dict[str, dace.dtypes.typeclass],
promotion_rules: Dict[FrozenSet[dace.dtypes.typeclass], dace.dtypes.typeclass],

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.

I think default promotion rule of if 2 variants X and Y -> promote the bigger type.

Also how do you handle if tasklet has 3 inputs? e.g. d = merge(c,a,b), which implements if c then a else b.
Does the rule work with 3 arrays?

@ThrudPrimrose ThrudPrimrose merged commit c33a073 into main Jun 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants