Conversation
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.
Title
Evo-1: avoid redundant vision QKV materialization
Summary
Adds an opt-in Evo-1 vision optimization that lets flash attention consume the strided Q/K/V layouts produced by
reshape + permutedirectly, instead of materializing contiguous F32 copies in every InternViT layer.Enable with:
VLA_EVO1_VISION_STRIDED_QKV=1The optimization is gated on flash attention being enabled. The existing contiguous path remains the default, and the non-flash attention path is unchanged.
Motivation
Evo-1's InternViT has 24 transformer layers. In the existing flash-attention path, each layer materializes contiguous Q, K, and V tensors after
reshape + permute.That results in three redundant F32 materializations per layer, or 72 per camera view.
CUDA flash attention can consume these strided layouts directly, so the extra materializations are unnecessary.
Performance
Tested on Jetson Orin Nano Super, CUDA 12.6, with:
Evo-1 LIBERO GGUF
3 camera views
448×448 input
BF16 activations
flash attention enabled
CUDA graphs enabled
horizon 50
32 flow steps
Matched steady-state A/B:
| Baseline | Strided QKV | Delta -- | -- | -- | -- Total latency | 1267.6 ms | 1174.9 ms | -92.7 ms (-7.3%) Vision latency | 725.7 ms | 632.0 ms | -93.7 ms (-12.9%)A separate 5-repetition optimized run measured approximately 1171.2 ms total and 630.5 ms vision.
The non-vision portion is effectively unchanged.
Numerical validation
A deterministic production-configuration A/B was run with 3×448 inputs, horizon 50, and all 32 flow steps.
The complete action output contains 1200 float32 values (50 × 24).
Baseline versus strided-QKV output:
The optimized path therefore produced byte-identical final actions in this deterministic test.
Compatibility
The optimization is opt-in and only activates when flash attention is enabled:
VLA_EVO1_VISION_STRIDED_QKV=1Without the environment variable, the existing contiguous Q/K/V path is retained.
When flash attention is disabled, the environment variable does not change the Q/K behavior and the existing non-flash V layout/materialization path remains in use.