Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5960d98
Improve figure clarity
Kyle1668 Jul 6, 2024
62a5fdf
Further improve figures
Kyle1668 Jul 6, 2024
7f11510
Reduce additional post-install steps
Kyle1668 Sep 4, 2024
ab99558
Fix constraint in exp run and begin on unlearning hparam search script
Kyle1668 Sep 4, 2024
b32e9af
Add bad vscode dbeug settings
Kyle1668 Sep 4, 2024
c711941
Maybe get unlearning and rmuw orking again
Kyle1668 Sep 4, 2024
ce33421
Ignore bad nodes
Kyle1668 Sep 4, 2024
cb7c8f8
Add calflops
Kyle1668 Sep 8, 2024
577176b
Begin improving project structure
Kyle1668 Sep 8, 2024
154cb21
Test commit with error
Kyle1668 Sep 8, 2024
ceeb85a
Test commit with error
Kyle1668 Sep 8, 2024
2471a7d
More code cleanup
Kyle1668 Sep 8, 2024
b44b013
lint test
Kyle1668 Sep 8, 2024
7fc3fbf
lint test
Kyle1668 Sep 8, 2024
aea6bcb
lint test
Kyle1668 Sep 8, 2024
f15b3a5
restructure project further
Kyle1668 Sep 9, 2024
5dd8f01
Got RMU single GPU working post-refactor
Kyle1668 Sep 9, 2024
085a134
Run RMU experiments
Kyle1668 Sep 12, 2024
99e86e8
Clean up slurm scripts
Kyle1668 Sep 12, 2024
5b7361c
Track ICLR experiment status
Kyle1668 Sep 12, 2024
c639bfa
Progress
Kyle1668 Sep 18, 2024
40bbbc0
Begin desinign launch jobs script
Kyle1668 Sep 18, 2024
f79d538
Added launch scripts
Kyle1668 Sep 29, 2024
47fff5a
Work on refactoring
Kyle1668 Sep 29, 2024
08a01fc
Remove old paper analysis
Kyle1668 Sep 29, 2024
95059dc
Pulled in latest arxiv analysis
Kyle1668 Sep 29, 2024
02e1fd2
Create new ICLR notebook
Kyle1668 Sep 29, 2024
82300b0
Brgin on ablation tables
Kyle1668 Sep 30, 2024
294aeb7
Resolve incoistent MEMIT results
Kyle1668 Sep 30, 2024
f9e2144
Make repo anon
Kyle1668 Sep 30, 2024
1d00b42
Add everything back
Kyle1668 Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ data/
wmdp/data/
models/
outputs/
calflops/
*.zip
.vscode/
out/
wandb/
slurm_logs/
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
hooks:
- id: ruff
- id: ruff-format
69 changes: 69 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "RMU",
"type": "debugpy",
"request": "launch",
"module": "lm_compose",
"python": "${command:python.interpreterPath}",
"console": "integratedTerminal",
"justMyCode": true,
"env": {
// "CUDA_VISIBLE_DEVICES": "0"
},
"args": [
// "model_name=mistralai/Mistral-7B-Instruct-v0.3",
// "model_name=Qwen/Qwen2.5-14B-Instruct",
"model_name=Qwen/Qwen2.5-7B-Instruct",
"tag=rmu_mistral_hparam_search",
"unlearn=rmu",
"interventions=[unlearn]",
"seed=42",
// "wandb=online",
"save_ckpt=False",
"rmu_alpha=[1000,1000]",
"rmu_layer_id=6",
"rmu_max_num_batches=450"
]
},
{
"name": "GD",
"type": "debugpy",
"request": "launch",
"module": "lm_compose",
"python": "${command:python.interpreterPath}",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"model_name=mistralai/Mistral-7B-Instruct-v0.3",
"tag=gd_mistral_hparam_search",
"unlearn=gd",
"interventions=[unlearn]",
"seed=42",
"wandb=online",
"save_ckpt=False",
"ga_train_size=10",
"ga_lr=1e-3",
"ga_retain_weight=100"
]
},
{
"name": "Wanda",
"type": "debugpy",
"request": "launch",
"module": "lm_compose",
"python": "${command:python.interpreterPath}",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"model_name=Qwen/Qwen2.5-7B-Instruct",
// "model_name=mistralai/Mistral-7B-Instruct-v0.3",
"tag=WANDA65%_DEBUG",
"interventions=[compression]",
"compression=wanda",
"sparsity_ratio=0.45",
]
},
]
}
6 changes: 3 additions & 3 deletions AutoAWQ/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ There are two versions of AWQ: GEMM and GEMV. Both names relate to how matrix mu

#### Compute-bound vs Memory-bound

At small batch sizes with small 7B models, we are memory-bound. This means we are bound by the bandwidth our GPU has to push around the weights in memory, and this is essentially what limits how many tokens per second we can generate. Being memory-bound is what makes quantized models faster because your weights are 3x smaller and can therefore be pushed around in memory much faster. This is different from being compute-bound where the main time spent during generation is doing matrix multiplication.
At small batch sizes with small 7B models, we are memory-bound. This means we are bound by the bandwidth our GPU has to push around the weights in memory, and this is essentially what limits how many tokens per second we can generate. Being memory-bound is what makes quantized models faster because your weights are 3x smaller and can therefore be pushed around in memory much faster. This is different from being compute-bound where the main time spent during generation is doing matrix multiplication.

In the scenario of being compute-bound, which happens at higher batch sizes, you will not gain a speed-up using a W4A16 quantized model because the overhead of dequantization will slow down the overall generation. This happens because AWQ quantized models only store the weights in INT4 but perform FP16 operations during inference, so we are essentially converting INT4 -> FP16 during inference.

Expand Down Expand Up @@ -168,13 +168,13 @@ prompt = "You're standing on the surface of the Earth. "\
"You end up exactly where you started. Where are you?"

tokens = tokenizer(
prompt_template.format(prompt=prompt),
prompt_template.format(prompt=prompt),
return_tensors='pt'
).input_ids.cuda()

# Generate output
generation_output = model.generate(
tokens,
tokens,
streamer=streamer,
max_new_tokens=512
)
Expand Down
2 changes: 1 addition & 1 deletion AutoAWQ/awq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.1.7"
from awq.models.auto import AutoAWQForCausalLM
from awq.models.auto import AutoAWQForCausalLM
12 changes: 0 additions & 12 deletions AutoAWQ/awq/models/__init__.py

This file was deleted.

92 changes: 0 additions & 92 deletions AutoAWQ/awq/models/_config.py

This file was deleted.

129 changes: 0 additions & 129 deletions AutoAWQ/awq/models/aquila.py

This file was deleted.

Loading