Skip to content

fix: rename device_id → device_ids for API consistency#1020

Open
shagsood wants to merge 1 commit into
quic:mainfrom
shagsood:fix/rename-device_id-to-device_ids
Open

fix: rename device_id → device_ids for API consistency#1020
shagsood wants to merge 1 commit into
quic:mainfrom
shagsood:fix/rename-device_id-to-device_ids

Conversation

@shagsood
Copy link
Copy Markdown

@shagsood shagsood commented Jun 2, 2026

QEFFAutoModelForCausalLM.generate() accepted device_id (singular) while all other model classes (QEFFAutoModel, QEFFAutoModelForImageTextToText, QEFFAutoModelForSpeechSeq2Seq, QEFFAutoModelForCTC, QAICInferenceSession) already used device_ids (plural). All accept List[int], so the singular name was misleading and required callers to look up the correct kwarg per class.

Rename device_iddevice_ids uniformly in:

  • QEFFAutoModelForCausalLM.generate() signature + docstring
  • cloud_ai_100_exec_kv() / latency_stats_bertstyle() in text_generation_inference.py
  • TextGeneration / TextGenerationMultiQPC constructors
  • VisionLanguageGeneration.init() + self.device_ids attribute
  • QEFFLoRAForCausalLM.generate()
  • cloud/infer.py, cloud/execute.py, utils/run_utils.py call sites
  • examples: basic_inference, moe_inference, continuous_batching, multi_adapter, on_device_sampling, text_inference_cpp

device_utils.get_available_device_id() is a different function (returns a single free device ID for probing); it is intentionally left unchanged.

QEFFAutoModelForCausalLM.generate() accepted `device_id` (singular)
while all other model classes (QEFFAutoModel, QEFFAutoModelForImageTextToText,
QEFFAutoModelForSpeechSeq2Seq, QEFFAutoModelForCTC, QAICInferenceSession)
already used `device_ids` (plural). All accept List[int], so the singular
name was misleading and required callers to look up the correct kwarg per
class.

Rename `device_id` → `device_ids` uniformly in:
  - QEFFAutoModelForCausalLM.generate() signature + docstring
  - cloud_ai_100_exec_kv() / latency_stats_bertstyle() in text_generation_inference.py
  - TextGeneration / TextGenerationMultiQPC constructors
  - VisionLanguageGeneration.__init__() + self.device_ids attribute
  - QEFFLoRAForCausalLM.generate()
  - cloud/infer.py, cloud/execute.py, utils/run_utils.py call sites
  - examples: basic_inference, moe_inference, continuous_batching,
    multi_adapter, on_device_sampling, text_inference_cpp

device_utils.get_available_device_id() is a different function (returns
a single free device ID for probing); it is intentionally left unchanged.

Signed-off-by: shagsood <shagsood@qti.qualcomm.com>
@shagsood shagsood force-pushed the fix/rename-device_id-to-device_ids branch from 7323d18 to 30c1914 Compare June 2, 2026 10:11
@vbaddi
Copy link
Copy Markdown
Contributor

vbaddi commented Jun 3, 2026

LGTM, thanks. @quic-rishinr can you check?

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