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

Two resample_by_picking in simple-dg TranslationUnit #245

Open
inducer opened this issue Jul 1, 2021 · 2 comments
Open

Two resample_by_picking in simple-dg TranslationUnit #245

inducer opened this issue Jul 1, 2021 · 2 comments

Comments

@inducer
Copy link
Owner

inducer commented Jul 1, 2021

I was just playing with (and being amazed by!) https://github.com/inducer/meshmode/pull/216.(https://github.com/inducer/meshmode/pull/216/commits/1de7f8f8fc3518ead4cd0191adf2238078636543 specifically, and inducer/pytato@585576a)

If I run python simple.dg --lazy and set a break point at https://github.com/inducer/arraycontext/blob/82b03d20849d9aac0f54cb4e9c00ba0f5908911c/arraycontext/impl/pytato/compile.py#L306, and then go

print(self.pytato_program.program)

the resulting TranslationUnit comes out with two copies of resample_by_picking that aren't visibly different:

>>> print(self.pytato_program.program)
---------------------------------------------------------------------------
KERNEL: resample_by_picking
---------------------------------------------------------------------------
ARGUMENTS:
ary: type: np:dtype('float64'), shape: (nelements_vec, n_from_nodes), dim_tags: (N1:stride:n_from_nodes, N0:stride:1), offset:  aspace: global
from_element_indices: type: np:dtype('int64'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
n_from_nodes: ValueArg, type: np:dtype('int32')
n_to_nodes: ValueArg, type: np:dtype('int64')
nelements: ValueArg, type: np:dtype('int64')
nelements_vec: ValueArg, type: np:dtype('int32')
pick_list: type: np:dtype('int32'), shape: (n_to_nodes), dim_tags: (N0:stride:1), offset:  aspace: global
result: type: np:dtype('float64'), shape: (nelements, n_to_nodes), dim_tags: (N1:stride:n_to_nodes, N0:stride:1), offset:  aspace: global
---------------------------------------------------------------------------
DOMAINS:
[nelements] -> { [iel] : 0 <= iel < nelements }
[n_to_nodes] -> { [idof] : 0 <= idof < n_to_nodes }
---------------------------------------------------------------------------
INAME IMPLEMENTATION TAGS:
idof: ConcurrentDOFInameTag()
iel: ConcurrentElementInameTag()
---------------------------------------------------------------------------
INSTRUCTIONS:
for idof, iel
    result[iel, idof] = ary[from_element_indices[iel], pick_list[idof]] if from_element_indices[iel] != -1 else 0  {id=insn}
end idof, iel
---------------------------------------------------------------------------
---------------------------------------------------------------------------
KERNEL: resample_by_picking_0
---------------------------------------------------------------------------
ARGUMENTS:
ary: type: np:dtype('float64'), shape: (nelements_vec, n_from_nodes), dim_tags: (N1:stride:n_from_nodes, N0:stride:1), offset:  aspace: global
from_element_indices: type: np:dtype('int32'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
n_from_nodes: ValueArg, type: np:dtype('int32')
n_to_nodes: ValueArg, type: np:dtype('int64')
nelements: ValueArg, type: np:dtype('int64')
nelements_vec: ValueArg, type: np:dtype('int32')
pick_list: type: np:dtype('int32'), shape: (n_to_nodes), dim_tags: (N0:stride:1), offset:  aspace: global
result: type: np:dtype('float64'), shape: (nelements, n_to_nodes), dim_tags: (N1:stride:n_to_nodes, N0:stride:1), offset:  aspace: global
---------------------------------------------------------------------------
DOMAINS:
[nelements] -> { [iel] : 0 <= iel < nelements }
[n_to_nodes] -> { [idof] : 0 <= idof < n_to_nodes }
---------------------------------------------------------------------------
INAME IMPLEMENTATION TAGS:
idof: ConcurrentDOFInameTag()
iel: ConcurrentElementInameTag()
---------------------------------------------------------------------------
INSTRUCTIONS:
for idof, iel
    result[iel, idof] = ary[from_element_indices[iel], pick_list[idof]] if from_element_indices[iel] != -1 else 0  {id=insn}
end idof, iel
---------------------------------------------------------------------------
(...SNIP...)

Any thoughts on why that might be?

cc @kaushikcfd @matthiasdiener

@kaushikcfd
Copy link
Collaborator

The dtypes of from_element_indices are different, unusure yet what's causing it.

< from_element_indices: type: np:dtype('int32'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
---
> from_element_indices: type: np:dtype('int64'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global

@inducer
Copy link
Owner Author

inducer commented Jul 1, 2021

Ah, good catch! I had missed that. This is likely on the meshmode end then. Moving there...

@inducer inducer transferred this issue from inducer/pytato Jul 1, 2021
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

No branches or pull requests

2 participants