CarperAI / CarperAI/trlx

Issue of tensors share memory

Open
#591 2 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
4.8k
Forks
487
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Describe the bug

I'm facing this issue of shared memory when training LLM models using TRLX

Some tensors share memory, this will lead to duplicate memory on disk and potential differences when loading them again: [{'base_model.transformer.wte.weight', 'base_model.lm_head.weight'}].
A potential way to correctly save your model is to use `save_model`.

Most of forums are recommending the below configuration to fix the issue for non-RL applications:

"save_safetensors=false"

Unfortunately, TRLX library doesn’t offer this argument which is part of Transformers module. Is there any way to define it equivalently in order to resolve the “tensors share memory” problem.

### Which trlX version are you using?

0.7.0

### Additional system and package information

Linux 20.04
python 3.11.8
pytorch 2.2.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.