Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions xtuner/v1/model/dense/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def fully_shard(
offload_policy=CPUOffloadPolicy() if self.fsdp_config.cpu_offload else None,
)
self.set_modules_to_forward_prefetch([self.embed_tokens, self.layers["0"]]) # type: ignore
list(self.layers.values())[-1].set_modules_to_forward_prefetch([self.norm, self.lm_head]) # type: ignore

self._to_empty_meta()

Expand Down
1 change: 1 addition & 0 deletions xtuner/v1/model/moe/moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ def fully_shard(
offload_policy=CPUOffloadPolicy() if self.fsdp_config.cpu_offload else None,
)
self.set_modules_to_forward_prefetch([self.embed_tokens, self.layers["0"]]) # type: ignore
list(self.layers.values())[-1].set_modules_to_forward_prefetch([self.norm, self.lm_head]) # type: ignore

for _, module in self.named_modules():
if isinstance(module, nn.Embedding):
Expand Down