Repository navigation
Replies: 1 comment
|
Short answer: LoRA on the 3B fits in 8 GB only if you load the base in 4-bit and keep Offload (your Q2). With world size 1, Memory. "3B" is really 3.83B params: 3.03B in the decoder linears plus two untied 131072×3072 tables ( The logits are the surprising part. Totals at micro batch 1, plus about 0.4 GiB of CUDA context:
1024 with NF4 is the setting I'd use. If the 4060 also drives your display, subtract whatever the desktop uses. The recipe's 8192 is out of reach on this card. Config (your Q1). Changing the path is enough as far as the architecture goes. The 3B and 8B repos ship byte-identical model:
_target_: nemo_automodel.NeMoAutoModelForCausalLM.from_pretrained
pretrained_model_name_or_path: nvidia/Nemotron-Labs-Diffusion-3B
torch_dtype: bfloat16 # was float32; keeps embed/head at 1.5 GiB instead of 3
trust_remote_code: true
dlm_paradigm: block_diff
block_size: 32
quantization:
load_in_4bit: true
load_in_8bit: false
bnb_4bit_compute_dtype: bfloat16
bnb_4bit_use_double_quant: true
bnb_4bit_quant_type: nf4
bnb_4bit_quant_storage: bfloat16
peft:
_target_: nemo_automodel.components._peft.lora.PeftConfig
match_all_linear: false
target_modules: ["*.q_proj", "*.k_proj", "*.v_proj", "*.o_proj", "*.gate_proj", "*.up_proj", "*.down_proj"]
dim: 16
alpha: 32
lora_dtype: float32 # with quantization, adapters otherwise default to bf16
distributed:
strategy: fsdp2
dp_size: none
tp_size: 1 # was 2
cp_size: 1
pp_size: 1
sequence_parallel: false
activation_checkpointing: true
mp_policy:
param_dtype: bfloat16
reduce_dtype: float32
output_dtype: float32
autocast_dtype: bfloat16
# offload_policy removed
dataset:
# path_or_dataset_id etc. -> your coding data
seq_length: 1024 # was 8192; longer samples get truncated
tokenizer:
pretrained_model_name_or_path: nvidia/Nemotron-Labs-Diffusion-3B
trust_remote_code: trueKeep the Untested parts: I couldn't find any config or test that combines
So you don't need to retrain it for correctness. After your fine-tune, though, it's aligned to the old verifier, and acceptance will probably drop by an amount I can't predict. Compare As for training code for it: I couldn't find any. Nothing in Automodel at this commit mentions |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'd like to fine-tune nvidia/Nemotron-Labs-Diffusion-3B (Instruct) on a narrow
coding task, using the hybrid AR + diffusion objective so all three decoding modes
keep working.
The documented recipes (examples/dllm_sft/nemotron_labs_diffusion_sft.yaml and
nemotron_labs_diffusion_lora.yaml) target the 8B model on 8 GPUs. My setup is a
single RTX 4060 (8GB VRAM) with 64GB system RAM, of which about 40GB is free for
training.
Questions:
anything else need adjusting?
training runs on an 8GB GPU with ~40GB of system RAM? Slow is fine, these would
be overnight runs.
(self-speculation drafter) be retrained, and is the code for that available?
Thanks!
All reactions