• Stefy Lanza (nextime / spora )'s avatar
    video: hook-based offload for injected cache components (fix device mismatch); gen retry safety net · 9ed35326
    Stefy Lanza (nextime / spora ) authored
    The incremental per-component cache built and cached all components correctly, but
    generation then failed:
    
      RuntimeError: Expected all tensors to be on the same device, but got index is on
      cuda:0, different from other tensors on cpu (... wrapper_CUDA__index_select)
    
    Cause: the load used the `balanced` (device_map) strategy. accelerate's device_map
    only dispatches components it LOADS — injected pre-loaded components keep whatever
    device they're on (CPU) with NO offload hook, so a forward pass mixes cuda inputs
    with cpu weights.
    
    Fix: when incremental cached components are injected, force a HOOK-based offload
    (model → group → sequential), which add offload hooks to EVERY component in the
    pipeline (injected included). model CPU offload keeps only the active ~7 GB 4-bit
    expert resident, so it fits easily and is fast. device_map strategies
    (balanced/disk) are skipped in this case.
    
    Safety net: a non-OOM generation failure that looks like a device mismatch now
    retries ONCE with the incremental cache disabled (plain build = pre-cache
    behaviour), so generation self-heals even if the injection path is imperfect
    instead of wedging the queue. (Load-time failures already fall back this way.)
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01RdMufYvtTbtGDWsiZVoXce
    9ed35326
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...
video_editor.config.json Loading commit data...