chore(trainer)!: remove ac_offloading.pin_memory (#3972)
This commit is contained in:
@@ -42,11 +42,10 @@ class ActivationCheckpointConfig(BaseConfig):
|
||||
|
||||
|
||||
class ActivationOffloadingConfig(BaseConfig):
|
||||
pin_memory: bool = True
|
||||
"""Pin offloaded activations to CPU memory."""
|
||||
"""Offload tensors saved for backward to pinned CPU memory during the forward pass."""
|
||||
|
||||
max_inflight_activations: int = Field(5, ge=1)
|
||||
"""Max activations kept in flight while offloading. More activations smooth overlap at the cost of GPU memory."""
|
||||
"""Max activations kept on GPU while their offload copies are in flight on the side stream. Higher values give more copy/compute overlap at the cost of GPU memory."""
|
||||
|
||||
|
||||
OffloadMode: TypeAlias = Literal["none", "optimizer", "full"]
|
||||
|
||||
@@ -324,7 +324,4 @@ def maybe_activation_offloading(config: ActivationOffloadingConfig | None) -> Of
|
||||
if config is None:
|
||||
return nullcontext()
|
||||
|
||||
return OffloadActivations(
|
||||
use_pin_memory=config.pin_memory,
|
||||
max_fwd_stash_size=config.max_inflight_activations,
|
||||
)
|
||||
return OffloadActivations(max_fwd_stash_size=config.max_inflight_activations)
|
||||
|
||||
Reference in New Issue
Block a user