Skip to content

Deploy LFS assets; stop bengio_infer from wedging the worker - #4

Merged
m-messer merged 1 commit into
mainfrom
fix-lfs-and-bengio-guard
Sep 2, 2026
Merged

Deploy LFS assets; stop bengio_infer from wedging the worker#4
m-messer merged 1 commit into
mainfrom
fix-lfs-and-bengio-guard

Conversation

@m-messer

@m-messer m-messer commented Sep 2, 2026

Copy link
Copy Markdown
Member

After the cold-start fix (#3), staging surfaced two model failures that the 30s timeout had been masking:

  • shannon_words_ngramMDB_INVALID: File is not an LMDB file
  • bengio_infertorch.load on a 133-byte file, unhandled exception, which killed the stdio RPC worker and 503'd every request for ~30s until shimmy respawned it

Both are Git LFS: *.mdb / *.pt are LFS-tracked but the deploy workflows checked out with lfs: false, shipping pointer stubs. basic_nn.pt predates the LFS filter (stored inline) so it was unaffected.

Changes

  • staging-deploy.yml / production-deploy.yml: lfs: true
  • bengio_infer.run(): wrap load+infer in try/except → return a failing Result instead of raising, so a bad asset degrades one request rather than taking down the worker
  • bengio_infer.predict_next(): clamp the re-encoded context to exactly N tokens (could exceed Nmat1 and mat2 shapes cannot be multiplied), so the model actually produces output once assets load

Verified against an image with real LFS assets: all five models (basic_nn, shannon_letters_single, shannon_letters_ngram, shannon_words_ngram, bengio_infer) return is_correct results. pytest passes.

🤖 Generated with Claude Code

After the cold-start fix, staging surfaced two model failures that were
previously masked by the timeout:

- shannon_words_ngram -> "MDB_INVALID: File is not an LMDB file"
- bengio_infer -> torch.load on a 133-byte file, unhandled exception,
  which killed the stdio RPC worker and 503'd every request for ~30s
  until shimmy respawned it.

Both are Git LFS: *.mdb / *.pt are LFS-tracked but the deploy workflows
checked out with lfs:false, shipping pointer stubs. basic_nn.pt predates
the LFS filter (stored inline) so it was unaffected.

- staging-deploy.yml / production-deploy.yml: lfs: true
- bengio_infer.run(): wrap load+infer in try/except -> return a failing
  Result instead of raising, so a bad asset degrades one request rather
  than taking down the worker
- bengio_infer.predict_next(): clamp the re-encoded context to exactly N
  tokens (it could exceed N and hit "mat1 and mat2 shapes cannot be
  multiplied"), so the model actually produces output once assets load

Verified against an image with real LFS assets: all five models
(basic_nn, shannon_letters_single, shannon_letters_ngram,
shannon_words_ngram, bengio_infer) return is_correct results. pytest passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UsgxJUsq1vG176rbznHRqz
@m-messer
m-messer merged commit 8446e81 into main Sep 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant