{{ message }}
Repository navigation
Add Intel XPU support for CogACT inference - #51
Closed
Talos (the-talos) wants to merge 1 commit into
Closed
Talos (the-talos) wants to merge 1 commit into
Talos (the-talos) wants to merge 1 commit into
Conversation
Add vla/device.py (XPU, then CUDA, then CPU; an explicit device always wins), make the mixed precision context in predict_action and predict_action_batch follow the device of the model, and let the SIMPLER policy wrapper pick the default device. Add mocked tests and an XPU sampler parity test, and a README subsection with the XPU install and run steps.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
vla/device.py: detection order XPU, then CUDA, then CPU, andresolve_device()where an explicit device is always honoured.predict_actionandpredict_action_batchwas hard-coded to"cuda". It now follows the device the model sits on (a newCogACT._autocast). On CUDA nothing changes, and on CPU autocast stays off as before.sim_cogact/cogact_policy.pymoves the model toresolve_device()instead of"cuda", which keepscudaon a CUDA host.ZE_AFFINITY_MASK).tests/test_device_agnostic.py.What I ran
CogACT/CogACT-Baseloaded throughload_vlawith the Prismatic SigLIP and DINOv2 backbones, backbone (thevlmmodule) in bf16 and action head in fp32 as in the README snippet, a structured 256x256 image, the instruction "pick up the red block",fractal20220817_data,cfg_scale=1.5, 3 DDIM steps, the same noise drawn on CPU and moved to the device. The (16, 7) action chunk, Intel Arc Pro B60 (torch 2.14.1+xpu, transformers 4.40.1) against CPU bf16: MSE 9.37e-08, relative MSE 4.08e-05, max abs diff 2.06e-03, 100% inside atol 2e-2 and rtol 1e-2, cosine 0.99998. For scale, CPU bf16 against CPU fp32 gives MSE 8.03e-08, relative MSE 3.49e-05, max abs diff 2.16e-03; XPU bf16 against CPU fp32 gives MSE 1.75e-07, relative MSE 7.60e-05, max abs diff 2.64e-03, 100% inside tolerance.Notes
vla/. No Flash Attention is used on this path.openvlapackage named inpyproject.toml; it importstensorflow,tensorflow_datasetsanddlimpat import time, so those must be importable. I ran with transformers 4.40.1 and timm 0.9.10 as pinned there.