Add DLA specific core usage (#18930)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Francesco Mattioli <Francesco.mttl@gmail.com>
Co-authored-by: Lakshantha Dissanayake <lakshanthad@yahoo.com>
This commit is contained in:
Abel Haro Armero 2025-01-30 10:34:26 +01:00 committed by GitHub
parent b91af4d3b0
commit a9182bdfab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,6 +293,12 @@ class AutoBackend(nn.Module):
except UnicodeDecodeError:
f.seek(0) # engine file may lack embedded Ultralytics metadata
model = runtime.deserialize_cuda_engine(f.read()) # read engine
if "dla" in str(device.type):
dla_core = int(device.type.split(":")[1])
assert dla_core in {0, 1}, (
"Expected device type for inference in DLA is 'dla:0' or 'dla:1', but received '{device.type}'"
)
runtime.DLA_core = dla_core
# Model context
try: