You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[LLM runner] Align make_image_input HWC contract with runtime behavior #22685
The Python type stub and pybind docstring advertise HWC, 1xHWC, CHW, and 1xCHW image tensors. Runtime checks accept contiguous CHW and 1xCHW, but reject ordinary contiguous HWC and 1xHWC.
The implementation squeezes rank-4 input before checking ChannelsLast; PyTorch reports that memory format as false for the resulting rank-3 tensor, so the HWC branch is effectively unreachable. Direct tests with the built binding confirmed both CHW forms pass and both HWC forms fail.
The examples in #22620 document only the verified CHW behavior. Runtime and type-stub changes are intentionally excluded from that documentation-only PR.
Proposed resolution
Choose and enforce one contract:
Implement real HWC and 1xHWC support with shape-aware conversion, or
Remove the unreachable HWC path and narrow the pybind docstring and _llm_runner.pyi contract to contiguous CHW and 1xCHW.
Test plan
Add positive and negative coverage for all four layouts, both supported dtypes, invalid batch size, and noncontiguous tensors.
My plan would be to add proper HWC support, convert it to CHW internally, and add tests for the supported layouts and dtypes.
Would this approach be welcome, and if so may I take this issue?
Activity
[docs] Refresh README, runtime APIs, and success stories (#22620)
fatih-uzlmz commentedon Sep 16, 2026
Hi @larryliu0820 @mergennachin!
I'd be interested in taking this on if nobody has started a fix yet,
My plan would be to add proper HWC support, convert it to CHW internally, and add tests for the supported layouts and dtypes.
Would this approach be welcome, and if so may I take this issue?
mergennachin commentedon Sep 16, 2026
@fatih-uzlmz Hello, yeah, please go ahead
fatih-uzlmz commentedon Sep 16, 2026
Hi @mergennachin, opened #22888 with the fix and tests. Lmk how everything looks!
[LLM runner] Support HWC inputs in make_image_input (#22888)