Skip to content
Merged
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
11 changes: 4 additions & 7 deletions examples/native_ds3/example_deepseek.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from dataclasses import dataclass
from typing import Literal

import moe_ops

import moe_ops # noqa: F401
import torch
import torch.nn.functional as F
from torch import nn
Expand Down Expand Up @@ -346,11 +345,12 @@ def init_weights(

if __name__ == "__main__":

from autoparallel.api import AutoParallel
from torch.distributed.fsdp import MixedPrecisionPolicy
from torch.distributed.tensor.placement_types import Replicate, Shard
from torch.testing._internal.distributed.fake_pg import FakeStore

from autoparallel.api import AutoParallel

# Model configuration
world_size = 256
fake_store = FakeStore()
Expand Down Expand Up @@ -409,10 +409,7 @@ def input_fn():
assert any(n.meta.get("fwd_nn_module_stack") for n in autop.gm.graph.nodes)
autop.add_parameter_memory_constraint(low=None, high=None)

x_sharding = (
Shard(0),
Shard(1),
) + (
x_sharding = (Shard(0), Shard(1),) + (
Replicate(),
) * (mesh.ndim - 2)

Expand Down
Loading
Loading