Skip to content

Consolidate device-to-queue mapping into constants.py#317

Open
khluu wants to merge 2 commits intomainfrom
refactor-consolidate-device-queue-mapping
Open

Consolidate device-to-queue mapping into constants.py#317
khluu wants to merge 2 commits intomainfrom
refactor-consolidate-device-queue-mapping

Conversation

@khluu
Copy link
Copy Markdown
Collaborator

@khluu khluu commented Mar 29, 2026

Summary

  • Add a DEVICE_TO_QUEUE dict in constants.py that serves as the single source of truth for mapping DeviceType to AgentQueue (covers all 26 device types with straightforward 1:1 mappings)
  • Replace the 45-line if-elif chain in get_agent_queue() with a concise dict lookup against DEVICE_TO_QUEUE, keeping only the branch-dependent docker logic and GPU-count fallback as special cases
  • Remove the duplicate 12-entry AMD queue mapping dict from _create_amd_mirror_step(), replacing it with a DEVICE_TO_QUEUE.get() call

Test plan

  • Verify pipeline generation produces identical output for existing step configurations (all device types should resolve to the same queues as before)
  • Verify docker image build steps still use branch-dependent queues (premerge vs postmerge)
  • Verify AMD mirror steps still resolve to correct AMD queues
  • Verify steps with num_devices 2 or 4 (and no explicit device type) still fall back to GPU_4
  • Verify default fallback to GPU_1 still works for unrecognized devices

🤖 Generated with Claude Code

khluu and others added 2 commits March 29, 2026 02:54
Replace the 45-line if-elif chain in get_agent_queue() with a dict lookup
against DEVICE_TO_QUEUE in constants.py. Also removes the duplicate AMD
queue mapping from _create_amd_mirror_step().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant