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
8 changes: 8 additions & 0 deletions examples/transformers/inference/gpt-oss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ python gpt_oss_standalone.py

### multi-card

1. run simple inference

```bash
mpirun -n 2 --map-by numa python gpt_oss_multiprocess.py
```

2. run gradio example

```bash
mpirun -n 2 --map-by numa python app_multiprocess.py
```
4 changes: 3 additions & 1 deletion mindnlp/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def send_forward(self, *args, **kwargs):

def receive_forward(self, *args, **kwargs):
hidden_states = args[0]
dist.irecv(hidden_states, src=self.src)
dist.recv(hidden_states, src=self.src)
output = self._forward(*((hidden_states,) + args[1:]), **kwargs)
return output

Expand Down Expand Up @@ -213,6 +213,8 @@ def wrapper(
weights_only,
)

return wrapper

def _get_resolved_checkpoint_files_wrapper(fn):
def wrapper(*args, **kwargs):
if GlobalComm.INITED and dist.get_world_size() > 1:
Expand Down
Loading