Skip to content

[shortfin_app.sd] failure to use model assets when spinning up SD server #2674

@bjacobgordon

Description

@bjacobgordon

Overview

Clues

Reproduction Steps

Starting at shark-ai root using Python 3.12.3

source .venv/bin/activate
pip install -r requirements.txt
cd shortfin
pip install -e .
python -m shortfin_apps.sd.server --device=amdgpu --device_ids=0 --build_preference=precompiled

Also occurs when compiling from scratch

python -m shortfin_apps.sd.server --device=amdgpu --device_ids=0 --build_preference=compile --compile_flags="--iree-hal-target-backends=rocm --iree-hip-target=gfx942"

Example

[2025-11-17 15:36:34.656] [info] [service.py:163] Loading inference program: clip, batch size 1, worker index: 0, device: [Device(name='amdgpu:0:0@0', ordinal=0:0, node_affinity=0, capabilities=0x0)]
[2025-11-17 15:36:34.656] [info] [utils.py:108] Shutting down system manager
[2025-11-17 15:36:34.656] [info] [utils.py:117] System manager command processor stopped
[2025-11-17 15:36:34] Traceback (most recent call last):
  File "/home/jagordon/repos/shark-ai/.venv/lib/python3.12/site-packages/starlette/routing.py", line 694, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/jagordon/repos/shark-ai/shortfin/python/shortfin_apps/sd/server.py", line 74, in lifespan
    service.start()
  File "/home/jagordon/repos/shark-ai/shortfin/python/shortfin_apps/sd/components/service.py", line 168, in start
    ] = self.create_program(
        ^^^^^^^^^^^^^^^^^^^^
  File "/home/jagordon/repos/shark-ai/shortfin/python/shortfin_apps/utils.py", line 531, in create_program
    return sf.Program(
           ^^^^^^^^^^^
ValueError: shortfin_iree-src/runtime/src/iree/hal/utils/executable_header.c:27: INVALID_ARGUMENT; executable file identifier does not match; expected `HIP1`; while invoking native function hal.executable.create; while calling import; 
[ 0] bytecode compiled_clip.__init:8448 [
    /home/eagarvey/.cache/shark/genfiles/sdxl/stable_diffusion_xl_base_1_0_clip_bs1_64_fp16.mlir:2:3,
   ...
    /home/eagarvey/.cache/shark/genfiles/sdxl/stable_diffusion_xl_base_1_0_clip_bs1_64_fp16.mlir:698:3
  ]

[2025-11-17 15:36:34] Application startup failed. Exiting.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions