Fix: pass --cuda flag to train_vae in bin subcommand#7
Open
rec3141 wants to merge 1 commit into
Open
Conversation
The `bin` subcommand accepts a `--cuda` argument but never passes it to `train_vae()`, which falls through to auto-detection via `torch.cuda.is_available()`. The `train` and `cluster` subcommands already pass `args.cuda` correctly (lines 256, 265). Without this fix, `LorBin bin --cuda` silently ignores the flag. Auto-detection still works in most cases, but explicit opt-in/opt-out is broken for the primary user-facing subcommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0f33182 to
aaf35c4
Compare
rec3141
added a commit
to rec3141/danaSeq
that referenced
this pull request
Feb 22, 2026
Idempotent script that applies four open PRs not yet merged upstream: - LorMeBioAI/LorBin#6: Fix sklearn n_neighbors=0 crash, NameError in mcluster, missing argparse type= annotations - LorMeBioAI/LorBin#7: Pass --cuda flag to train_vae in bin subcommand - LottePronk/whokaryote#13: Fix GFF3 parsing for Bakta/PGAP output - oschwengers/bakta#429: Make AMRFinderPlus failure non-fatal (warn + return) Run once after install.sh. Safe to re-run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
binsubcommand accepts a--cudaargument (line 197) but never passes it totrain_vae()on line 238, which falls through to auto-detection viatorch.cuda.is_available()trainandclustersubcommands already passargs.cudacorrectly (lines 256, 265)train_vae(logger, args.output, epoch=args.epoch)→train_vae(logger, args.output, epoch=args.epoch, is_cuda=args.cuda)Impact
Without this fix,
LorBin bin --cudasilently ignores the--cudaflag. Auto-detection still works when CUDA is available, but explicit opt-in (forcing GPU on ambiguous systems) and opt-out (forcing CPU when GPU is present) are broken for the primary user-facing subcommand.Test plan
train_vaesignature acceptsis_cudakwarg (line 63)trainandclustersubcommands already use this pattern--cudais not passed (args.cudadefaults toFalse, buttrain_vaetreatsFalsevsNonedifferently —Falsedisables CUDA,Nonetriggers auto-detection)Note: Since
args.cudaisFalse(notNone) when--cudais omitted, this change meansLorBin binwithout--cudawill now disable GPU rather than auto-detect. If the intended default is auto-detection, the fix should useargs.cuda if args.cuda else Noneinstead, or change the argparse default toNone.🤖 Generated with Claude Code