Skip to content

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Dec 4, 2025

Resumed from #139.


Relevant parts of summary from #139 follow:

Remaining porting issues

  • Move caching to the array context from KernelCacheMixin.
  • Handle kernel optimizations.
    • Currently it uses get_cached_executor(), which branches on OPT_ENABLED, but we need to move to actx.call_loopy.
    • Move to transform_loopy_program? Would need to also add some fancy tags or something to customize it?
  • Need to move e.g. register_optimization_preambles to the array context somehow too.
    • The kernels no longer have a context or device, so they can't do that.
    • Probably need to move this to actx.transform_loopy_program somehow?

Upstream / downstream PRs

Speculative TODOs

  • Should some classes clone the actx? Here e.g. SumpyTreeIndependentDataForWrangler but also in boxtree.
    • The big worry is that cloning throws away any caches on the actx.
    • Pretty much all *Builder classes can be functions + all other memoized kernels can be functions, but should leave that for later since it can be done without breaking the world.
  • Rip out the timing stuff (not sure, just mentioned by @inducer at some point).
    • This would also need to be done in boxtree?
  • Add an array context to do the timing stuff? (likely for a future PR)

@inducer inducer mentioned this pull request Dec 4, 2025
25 tasks
@inducer inducer force-pushed the towards-array-context-merge branch from 3b5fb71 to a073ba5 Compare December 4, 2025 21:10
@inducer inducer changed the title Towards array context Towards array context (2025 merge) Dec 4, 2025
@inducer inducer force-pushed the towards-array-context-merge branch from a073ba5 to ab5da74 Compare December 9, 2025 20:20
@inducer inducer force-pushed the towards-array-context-merge branch from f214429 to 53b6fc3 Compare December 9, 2025 22:40
@inducer inducer force-pushed the towards-array-context-merge branch from 6f1f569 to 22b9b8f Compare December 10, 2025 21:39
@inducer
Copy link
Owner Author

inducer commented Dec 10, 2025

FYI: As in boxtree, I've moved towards annotating with ArrayContext instead of PyOpenCLArrayContext. I like that direction because it conveys the ambition (cough) that all this will work with any actx. It also prevents having to splatter actx-type asserts everywhere downstream. If you hate it, it's a single commit that could be unwound.

@inducer
Copy link
Owner Author

inducer commented Dec 10, 2025

FYI2: The local tests are now passing here, so maybe this can become #139? (I.e. I would push this code there?) Does that sound OK?

@alexfikl
Copy link
Collaborator

FYI2: The local tests are now passing here, so maybe this can become #139? (I.e. I would push this code there?) Does that sound OK?

Definitely! I'm fine with continuing the work here too, whatever's more convenient.

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.

3 participants