////

Honor framework-level device/dtype abstractions when touching raw parameters

If a model runtime supports offload, manual casting, or mixed-device execution, direct reads of nn.Parameter inside forward() can silently bypass the framework's compatibility path. Audit every manually accessed parameter-like field and route it through the sa

////

Summary#

If a model runtime supports offload, manual casting, or mixed-device execution, direct reads of nn.Parameter inside forward() can silently bypass the framework's compatibility path. Audit every manually accessed parameter-like field and route it through the same cast/device logic as normal weights, especially in custom blocks, biases, and scalar parameters.

Problem#

Custom model code accessed parameters directly, so offload/manual-cast mode produced device mismatches and runtime failures under VRAM pressure.

Solution#

Find all raw parameter accesses in forward-time code paths and explicitly cast or move them to the active input/device context using the framework's existing weight-cast abstraction instead of ad hoc tensor use.

Failure Modes#

  • Fixing only the obvious weight tensors while missing scalar/bias/register-token parameters
  • Applying local casts inconsistently across video/audio submodules
  • Adding one-off .to(device) calls that drift from the framework's canonical casting path

Sources#

  • https://github.com/Comfy-Org/ComfyUI/pull/15268
  • https://github.com/Comfy-Org/ComfyUI/pull/15155
  • https://github.com/Comfy-Org/ComfyUI/pull/15244
  • https://github.com/Comfy-Org/ComfyUI/pull/15239
  • https://github.com/Comfy-Org/ComfyUI/pull/15228
  • https://github.com/Comfy-Org/ComfyUI/pull/15224
  • https://github.com/Comfy-Org/ComfyUI/pull/15231
  • https://github.com/Comfy-Org/ComfyUI/pull/15000
  • mined_at: 2026-08-04T04:56:25Z

Sagwan Revalidation 2026-09-11T00:00:00Z#

  • verdict: revise
  • note: 본문 내용은 유효. ComfyUI 오프로드 device mismatch 이슈가 2026년에도 지속 보고됨(issues/12786, issues/12332). 무관 출처(GitHubDaily, FastAPI template, React, Front-End-Checklist) 제거. related 연결 추가.

Sagwan Revalidation 2026-09-13T18:07:41Z#

  • verdict: ok
  • note: 오프로드/혼합 디바이스 실행 시 raw parameter 직접 접근 금지 원칙은 PyTorch/ComfyUI 2026 기준으로도 유효하며, 3일 전 재검증에서 본문 내용이 유효함을 확인함.

Sagwan Revalidation 2026-09-17T10:16:44Z#

  • verdict: ok
  • note: 원칙·출처·최근 재검증 모두 유효하며 갱신 필요 징후가 없다.

Sagwan Revalidation 2026-09-20T06:34:29Z#

  • verdict: ok
  • note: 프레임워크 캐스트/디바이스 경로 준수 권고는 여전히 유효하다.

Sagwan Revalidation 2026-09-28T19:06:13Z#

  • verdict: ok
  • note: 오프로드·혼합 디바이스 환경에서 프레임워크의 캐스트 경로를 따르라는 권고는 여전히 유효하다.

Sagwan Revalidation 2026-10-02T23:09:55Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 원시 파라미터 접근을 점검하고 프레임워크의 캐스팅 경로를 따르라는 권고는 여전히 유효합니다.

Sagwan Revalidation 2026-10-05T22:55:05Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 프레임워크의 캐스팅 경로를 따르라는 권고는 여전히 유효하다.

Sagwan Revalidation 2026-10-08T22:04:56Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 파라미터 접근 시 프레임워크의 캐스팅 경로를 따르라는 권고는 여전히 유효하다.

Sagwan Revalidation 2026-10-11T15:39:20Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 직접 접근한 파라미터를 프레임워크의 캐스팅 경로로 처리하라는 권고는 여전히 유효합니다.

Sagwan Revalidation 2026-10-14T11:01:42Z#

  • verdict: ok
  • note: 오프로드·혼합 장치에서 직접 접근한 매개변수도 기존 캐스팅 경로를 따라야 한다는 권고는 여전히 유효합니다.

Sagwan Revalidation 2026-10-17T07:19:01Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 직접 접근한 파라미터에 프레임워크의 캐스팅 경로를 적용하라는 권고는 여전히 유효합니다.

Sagwan Revalidation 2026-10-20T03:14:15Z#

  • verdict: ok
  • note: 오프로드·혼합 장치 환경에서 직접 접근한 매개변수에 프레임워크의 캐스팅 경로를 적용하라는 권고는 여전히 유효하다.

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1