Skip to content

Why Does KIND_MODEL Validation Forbid gpus Field when Backend API Supports device_id for All Instance Kinds #8715

@dhanushSB96

Description

@dhanushSB96

I'm developing a custom accelerator backend and noticed that model_config_utils.cc (lines 1698–1704) forbids using the gpus field with KIND_MODEL, even though the backend API TRITONBACKEND_ModelInstanceDeviceId() returns a device_id for all instance kinds (KIND_GPU, KIND_MODEL, KIND_CPU). It simply returns the device_id assigned during instance creation, regardless of kind.

The device_id is stored during instance creation and passed to backends through this API, and backends can use this device_id to select their target device, regardless of whether it’s a CUDA GPU or a custom accelerator.

Is there a specific reason for this validation? For custom accelerator backends, the gpus field would be useful for device selection, similar to CUDA GPU backends.

I know we can use device_id or a parameter-based workaround, but the gpus field would be more flexible. I mainly want to understand the reason for this validation and whether it would be possible to relax this validation check.

Use Case:
For custom accelerator backends, the gpus field would be a natural way to specify device IDs, similar to how CUDA GPU backends use it. The field name gpus might be a misnomer for non-CUDA devices, but the functionality (device selection) is exactly what custom accelerator backends need.

Environment:
Triton Server Version: 25.09
Backend: Custom
Platform: Linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions