Skip to content

[Test] Run the ndarray autodiff tests on Metal and restrict f64 to where it is required.#800

Merged
duburcqa merged 1 commit into
mainfrom
duburcqa/broaden_ndarray_ad_test_backends
Jul 22, 2026
Merged

[Test] Run the ndarray autodiff tests on Metal and restrict f64 to where it is required.#800
duburcqa merged 1 commit into
mainfrom
duburcqa/broaden_ndarray_ad_test_backends

Conversation

@duburcqa

@duburcqa duburcqa commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Issue: #

Stacked on #799 (the loop-carried-vector adstack fix); review/merge that first. Base retargets to main once #799 lands.

Brief Summary

copilot:summary

Walkthrough

copilot:walkthrough

from tests import test_utils

archs_support_ndarray_ad = [qd.cpu, qd.cuda, qd.amdgpu]
archs_support_ndarray_ad = [qd.cpu, qd.cuda, qd.amdgpu, qd.metal]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vulkan is still excluded?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Vulkan is half-broken at the moment. Exploring...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Not pushing to fix it. (was just asking on the off-chance we could simply drop the list of platforms altogether, and run on all)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it is: #801

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

@duburcqa
duburcqa force-pushed the duburcqa/broaden_ndarray_ad_test_backends branch from c10c1a6 to 1beb1a6 Compare July 20, 2026 19:07
@duburcqa
duburcqa changed the base branch from main to duburcqa/fix_adstack_tensor_loop_carried_grad July 20, 2026 19:07
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

@hughperkins

Copy link
Copy Markdown
Collaborator
  • test only change ✅
  • ad only change ✅
  • no user doc-facing changes required ✅

what is changing:

  • broadening tests to include metal too (still missing vulkan, but it's strictly wider coverage, as far as platforms)
  • swapping many tests from f64 to f32 (different coverage (f64 vs f32), but strictly same number of tests running)

ok to merge

Base automatically changed from duburcqa/fix_adstack_tensor_loop_carried_grad to main July 21, 2026 19:08
…ere it is required.

The ndarray reverse-mode autodiff tests were pinned to `[cpu, cuda, amdgpu]`, which skipped
Metal even though ndarray autodiff works there. Most tests only carried `default_fp=qd.f64`
(or f64-typed dataclass ndarrays) incidentally - their arrays are f32 and their assertions
are exact small integers or trivial (fibonacci, powers of two, sin(0)/cos(0)) - so f64 was
not load-bearing. Drop f64 from those so they run on Metal too, and convert the dataclass
ndarray tests from f64 to f32 for the same reason.

The few tests that genuinely need f64 (an explicit `qd.cast(..., f64)` body, f64-typed
ndarrays, or f64 fields) now require `qd.extension.data64`, so they skip cleanly on backends
without 64-bit support instead of raising. Metal is added to the shared arch list.
@duburcqa
duburcqa force-pushed the duburcqa/broaden_ndarray_ad_test_backends branch from 1beb1a6 to d1bcdc4 Compare July 21, 2026 19:22
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

@duburcqa
duburcqa merged commit 7381611 into main Jul 22, 2026
66 of 67 checks passed
@duburcqa
duburcqa deleted the duburcqa/broaden_ndarray_ad_test_backends branch July 22, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants