Skip to content

[OpenCOOD] Bypass self-attention for single-CAV inputs - #195

Merged
Haralishev77 merged 2 commits into
mainfrom
patch/avoid-dispatching-self-attn
Sep 1, 2026
Merged

Haralishev77 merged 2 commits into
mainfrom
patch/avoid-dispatching-self-attn

Conversation

@Haralishev77

Copy link
Copy Markdown
Member

Description

Add a fast path for single-CAV inputs in ScaledDotProductAttention.

Since attention over a single element always produces the input value, return it directly. This avoids dispatching degenerate matrix multiplications to backend-specific JIT kernels such as Triton while preserving the original result.

Changes

  • Bypass attention computation for single-CAV inputs.
  • Keep multi-CAV behavior unchanged.

Validation

  • Simulation run with Artery
  • Manual verification

Checklist

  • Kept the PR focused and reviewable

@Haralishev77
Haralishev77 requested a review from AndK17 September 1, 2026 11:41
@Haralishev77 Haralishev77 self-assigned this Sep 1, 2026
@Haralishev77 Haralishev77 added OpenCOOD Some changes in OpenCOOD module CoP Something new in cooperative perception category labels Sep 1, 2026
@Haralishev77
Haralishev77 merged commit a670c89 into main Sep 1, 2026
8 checks passed
@Haralishev77
Haralishev77 deleted the patch/avoid-dispatching-self-attn branch September 1, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CoP Something new in cooperative perception category OpenCOOD Some changes in OpenCOOD module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants