hassanshka commited on
Commit
6954fd0
·
verified ·
1 Parent(s): fcca275

Add extraction script: extract_lora_256.sh

Browse files
extraction_scripts/extract_lora_256.sh ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH --job-name=dequant_extract
3
+ #SBATCH --output=process_%j.log
4
+ #SBATCH --error=process_%j.err
5
+ #SBATCH --time=04:00:00
6
+ #SBATCH -p kisski-h100
7
+ #SBATCH -G H100:4
8
+ #SBATCH --nodes=1
9
+ #SBATCH --ntasks-per-node=1
10
+ #SBATCH --cpus-per-task=64
11
+ #SBATCH -C inet
12
+
13
+ source activate /projects/extern/kisski/kisski-narges-llm-interactive/dir.project/surgery
14
+
15
+ # PATHS
16
+ BIOMNI_MODEL="/projects/extern/kisski/kisski-narges-llm-interactive/dir.project/Biomni-R0-32B-Preview"
17
+ TEMP_BASE="./temp_qwen_dequantized_bf16" # The folder the python script creates
18
+ OUTPUT_LORA="./lora_extraction_results/lora_fp8_corrected_rank_256"
19
+
20
+ # 2. RUN MERGEKIT
21
+ # Now we use the TEMP_BASE (which is now BF16) as the base model.
22
+ # MergeKit will see two BF16 models and be happy.
23
+ echo "------------------------------------------------"
24
+ echo "STEP 2: extracting LoRA using MergeKit..."
25
+ echo "------------------------------------------------"
26
+
27
+ mergekit-extract-lora \
28
+ --model "$BIOMNI_MODEL" \
29
+ --base-model "$TEMP_BASE" \
30
+ --out-path "$OUTPUT_LORA" \
31
+ --max-rank 256 \
32
+ --device cuda \
33
+ --no-lazy-unpickle
34
+
35
+
36
+ echo "✅ ALL DONE. Your mathematically corrected LoRA is in $OUTPUT_LORA"