wenmin-wu/ds-skills/8bit-optimizer-embedding-override
Claude Code and agent skill by wenmin-wu/ds-skills
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Uses bitsandbytes 8-bit AdamW to halve optimizer memory, with a 32-bit override for embedding weights to prevent instability.
Install
npx vskill@latest install wenmin-wu/ds-skills/8bit-optimizer-embedding-overrideSKILL.md
8-Bit Optimizer with Embedding Override
Overview
Optimizer states (momentum + variance in Adam) consume 2x the model size. BitsAndBytes 8-bit AdamW quantizes these states to 8-bit, cutting optimizer memory by ~75%. However, embedding layers are sensitive to quantization noise. Override embedding weights to use 32-bit optimizer states while keeping everything else at 8-bit.
Quick Start
Workflow
- Install bitsandbytes (
pip install bitsandbytes) - Replace
torch.optim.AdamWwithbnb.optim.AdamW(optim_bits=8) - Register 32-bit overrides for embedding submodules via
GlobalOptimManager - Train normally — optimizer automatically handles quantized state updates
Key Decisions
- Which layers to override: Embeddings are critical; other layers tolerate 8-bit well
- Memory savings: ~75% optimizer memory reduction (32-bit → 8-bit states)
- Compatibility: Works with any PyTorch model, not just HuggingFace
- Combine with: Layer freezing + gradient checkpointing for maximum memory efficiency
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/nlp/8bit-optimizer-embedding-override/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wenmin-wu/ds-skills/8bit-optimizer-embedding-override)