inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

Copy `axes` and `tags` in `zeros_like`/`full_like` #229

Closed majosm closed 1 year ago

majosm commented 1 year ago

Am I doing this right? (As far as I could tell, pt.zeros/pt.full don't accept axes or tags directly.)

This makes all of the RHS "uninferred axes" warnings go away in my Y3 prediction smoke_test run.

cc @anderson2981

inducer commented 1 year ago

LGTM!

inducer commented 1 year ago

(And thanks for getting that done.)

majosm commented 1 year ago

Looks like this change is making the stock prediction driver (not my slightly-modified version) fail CI: https://github.com/illinois-ceesd/mirgecom/actions/runs/4896641880/jobs/8744004554. @MTCam confirmed by swapping arraycontext versions. Any idea what could be causing this @inducer, @kaushikcfd?

inducer commented 1 year ago

I think I understand how this could happen, and I think one way to obviate the issue for now would be to delete the offending assert.

FEMEinsumTags are supposed to come only into existence as part of the transform path, and so it's a problem if they exist "before they're even supposed to be created". The bit of code that the assert is part of ensures that only "input-type" arrays (Placeholder, DataWrapper) have this issue. This change to zeros_like permits that tag to "jump" to IndexLambdas, too. I suppose that the cleaner solution would ultimately be to ensure that the tag does not escape the transform process, but deleting the assert should do the trick for now.

@kaushikcfd, LMK if I've got this wrong.

kaushikcfd commented 1 year ago

That assessment seems correct. The FEMEinsumTag was a broken abstraction, the newest version of kaushikcfd@meshmode is based on the implementation in #217 which gets rid of them.