Skip to content

Fix grid-to-point interpolation edge cases#1813

Draft
loliverhennigh wants to merge 2 commits into
mainfrom
codex/grid-to-point-interpolation-fixes
Draft

Fix grid-to-point interpolation edge cases#1813
loliverhennigh wants to merge 2 commits into
mainfrom
codex/grid-to-point-interpolation-fixes

Conversation

@loliverhennigh

Copy link
Copy Markdown
Collaborator

PhysicsNeMo Pull Request

Description

Hardens grid_to_point_interpolation for use inside differentiable geometry functionals.

This fixes three independent edge cases in the existing operation:

  • stride-2 interpolation now selects a real cell at inclusive grid endpoints, preserving correct one-sided query gradients;
  • exact endpoints remain distinct from inward float32 neighbors and interior grid nodes on both Torch and Warp;
  • Torch coordinate metadata no longer inherits the process-wide default dtype, and Warp custom-op views no longer request duplicate gradient tracking.

The Warp implementation receives the original logical bounds and computes endpoint-adjacent cells and fractions without a size-scaled tolerance band. Tests cover 1D, 2D, and 3D endpoint gradients, exact-vs-nextafter behavior, interior-node rounding, dtype preservation, and non-leaf custom-op inputs.

Validation

  • 47 passed in test_grid_to_point_interpolation.py
  • 167 passed, 16 skipped across geometry functionals and grid-to-point interpolation
  • all changed-file pre-commit hooks pass

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The CHANGELOG.md is up to date with these changes.
  • An issue is linked to this pull request.
  • Model implementation standards are not applicable.

Dependencies

None.

@copy-pr-bot

copy-pr-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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.

1 participant