扩展文本长度失败
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.3k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
在config配置中更新相关参数
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
config.update({"n_positions": 4000})
config.update({"max_position_embeddings": 4000})
model = AutoModelForCausalLM.from_pretrained(
model_path,
trust_remote_code=True,
load_in_8bit=True,
device_map='auto',
torch_dtype=torch.float16,
config=config
)
可以发现self.causal_mask成功初始化为[1, 1, 4000, 4000].
然而在_att中再次打印self.causal_mask,shape会重新变为[1, 1, 2048, 2048] 导致尺寸不匹配问题。
为什么register_buffer后矩阵尺寸会变?哪里还存在修改self.causal_mask的逻辑吗?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the configuration in the issue and inspect modeling_moss.py, especially the causal_mask initialization and the _att method linked in the report. Trace assignments or buffer handling between those points to identify why the shape returns to 2048. Done means explaining the reset path and confirming the resulting mask dimensions no longer mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100