Skip to content

Fix PSO bound device transfer - #253

Merged
BillHuang2001 merged 1 commit into
EMI-Group:mainfrom
Arthur031221:fix/pso-workflow-device-20261007
Oct 13, 2026
Merged

BillHuang2001 merged 1 commit into
EMI-Group:mainfrom
Arthur031221:fix/pso-workflow-device-20261007

Conversation

@Arthur031221

Copy link
Copy Markdown
Contributor

Description

PSO created on CPU fails on its first step when StdWorkflow moves it to CUDA because its bounds stay on the CPU. Registering the bounds as nonpersistent buffers lets device and dtype transfers move them while preserving existing checkpoint keys.

This regression is based on the code @ZaberKo posted in #245 for PSO.

Tested with .venv/bin/python -m unittest -q unit_test.algorithms.test_pso_variants.

Checklist

  • I have formatted my Python code with ruff.
  • I have good commit messages.
  • If adding new algorithms, problems, operators:
    • Added related test cases.
    • Added docstring to explain important parameters.
    • Added entries in the docs.

I used Claude/Codex to assist with preparing, checking and double-checking this change.

Co-authored-by: Zaber [email protected]

Co-authored-by: Zaber <[email protected]>
Signed-off-by: Arthur031221 <[email protected]>
@BillHuang2001
BillHuang2001 merged commit 30c4f91 into EMI-Group:main Oct 13, 2026
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