Skip to content

[bsr_add] fix the cuda bsr add path and add the cpu one#19

Merged
zitongzhan merged 3 commits intoreleasefrom
fix_bsr_add
Apr 1, 2026
Merged

[bsr_add] fix the cuda bsr add path and add the cpu one#19
zitongzhan merged 3 commits intoreleasefrom
fix_bsr_add

Conversation

@zitongzhan
Copy link
Copy Markdown
Collaborator

@zitongzhan zitongzhan commented Apr 1, 2026

  • Inspect failing CI runs for this branch and confirm root cause
  • Revert the CPU execution expansion in tests/autograd/test_bal_jacobian.py by restoring the CUDA-only guards
  • Revert the device-parametrize expansion in tests/sparse/test_bsr.py back to CUDA-only
  • Verify the working tree only contains the intended reverts

@zitongzhan
Copy link
Copy Markdown
Collaborator Author

@copilot This PR makes it possible for CPU to perform the BSR add operation. Therefore, many test verifying the correctness of Jacobian that was skipped on non-CUDA device can be relaxed and added back. Identify them.

… add is supported

Agent-Logs-Url: https://github.com/sair-lab/bae/sessions/c8ccdd05-bc87-417a-80b2-a438ff812653

Co-authored-by: zitongzhan <24406547+zitongzhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@copilot This PR makes it possible for CPU to perform the BSR add operation. Therefore, many test verifying the correctness of Jacobian that was skipped on non-CUDA device can be relaxed and added bac...

Identified and addressed in commit 0d21a05:

tests/autograd/test_bal_jacobian.py — removed two if device.type != "cuda": return early-exit guards:

  • test_bal_jacobian_structure_no_empty_columns: the end-to-end LM optimization + per-pixel error check now runs on CPU too
  • test_bal_jacobian_cat_fixed_first_camera_gauge_free: same for the fixed-first-camera variant

tests/sparse/test_bsr.py — extended the test_universal device parametrize from ['cuda'] to ['cpu', 'cuda'], with a skip for torch.matmul on CPU (BSR matmul still requires CUDA/warp kernels) and a skip when CUDA is unavailable. This lets torch.add, torch.diag, and diag_clamp_oop all run on CPU.

…PU runners

Agent-Logs-Url: https://github.com/sair-lab/bae/sessions/aff0ed51-66f5-4040-be7d-8c19786ebaee

Co-authored-by: zitongzhan <24406547+zitongzhan@users.noreply.github.com>
@zitongzhan zitongzhan merged commit c22995c into release Apr 1, 2026
3 checks passed
@zitongzhan zitongzhan deleted the fix_bsr_add branch April 1, 2026 19:55
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.

2 participants