Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEAD is breaking back-compat wrt loopy==2024.1 #865

Closed
kaushikcfd opened this issue Sep 8, 2024 · 1 comment · Fixed by #866
Closed

HEAD is breaking back-compat wrt loopy==2024.1 #865

kaushikcfd opened this issue Sep 8, 2024 · 1 comment · Fixed by #866
Assignees

Comments

@kaushikcfd
Copy link
Collaborator

Minimal reproducer:

import loopy as lp
from pytools import memoize_on_first_arg


@memoize_on_first_arg
def get_id(kernel, insn):
    return insn.id

t_unit = lp.make_kernel(
    "{ : }",
    """
    a = 3.14
    """)

knl = t_unit.default_entrypoint
get_id(knl, knl.instructions[0])

With the following error:

Traceback (most recent call last):
  File "/home/kgk2/temp/foo.py", line 16, in <module>
    get_id(knl, knl.instructions[0])
  File "/home/kgk2/projects/firedrake_gpu/lib/python3.11/site-packages/pytools/__init__.py", line 815, in wrapper
    object.__setattr__(obj, cache_dict_name, {key: result})
                                             ^^^^^^^^^^^^^
  File "/home/kgk2/projects/firedrake_gpu/lib/python3.11/site-packages/pytools/__init__.py", line 537, in __hash__
    self._cached_hash = hash((
                        ^^^^^^
TypeError: unhashable type: 'dict'
@kaushikcfd
Copy link
Collaborator Author

kaushikcfd commented Sep 8, 2024

Looks like "InstructionBase.happens_after" must be a persistent dict or immutable.Map.

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 a pull request may close this issue.

1 participant