microsoft / microsoft/KBLaM

Error in __init_rope of KblamLlamaAttention

Open
#37 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
1.5k
Forks
125
Avg merge
22d 8m
Merged PRs (30d)
1

Description

It seems that the configuration information in 'meta-llama/Llama-3.2-1B-Instruct/resolve/main/config.json' has changed since the code was used the last time.

Running the training on the enron dataset gives:

File "/home/fokus/Thomas/KBLaM/src/kblam/models/llama3_model.py", line 118, in __init__ self._init_rope() ~~~~~~~~~~~~~~~^^ File "/home/fokus/Thomas/KBLaM/src/kblam/models/llama3_model.py", line 128, in _init_rope scaling_type = self.config.rope_scaling["type"] ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'type'
Printing out self.config.rope_scaling gives:

{'factor': 32.0, 'high_freq_factor': 4.0, 'low_freq_factor': 1.0, 'original_max_position_embeddings': 8192, 'rope_type': 'llama3'}
I assume that the rope_type is fetched from https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct/resolve/main/config.json.

Changing self.config.rope_scaling["type"] to self.config.rope_scaling["rope_type"] gives now

File "/home/fokus/Thomas/KBLaM/src/kblam/models/llama3_model.py", line 146, in _init_rope raise ValueError(f"Unknown RoPE scaling type {scaling_type}") ValueError: Unknown RoPE scaling type llama3
since only the values 'linear' or 'dynamic' are allowed in _init_rope()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/kblam/models/llama3_model.py at init and _init_rope, then compare the current Hugging Face Llama-3.2-1B-Instruct config.json fields with the supported scaling types. Reproduce the failure by running training on the enron dataset. Done means initialization handles the reported configuration without KeyError or an unknown-scaling-type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.