MiniMax-AI commited on
Commit
4ca1b78
·
1 Parent(s): 372fb1d

Fix world_size in QuickStart Code

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -170,15 +170,15 @@ quantization_config = QuantoConfig(
170
  + [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.num_hidden_layers)]
171
  )
172
 
 
 
 
173
  # set device map
174
  device_map = {
175
  'model.embed_tokens': 'cuda:0',
176
  'model.norm': f'cuda:{world_size - 1}',
177
  'lm_head': f'cuda:{world_size - 1}'
178
  }
179
- # assume 8 GPUs
180
- world_size = 8
181
- layers_per_device = hf_config.num_hidden_layers // world_size
182
  for i in range(world_size):
183
  for j in range(layers_per_device):
184
  device_map[f'model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
@@ -239,4 +239,4 @@ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
239
  ## 6. Chatbot & API
240
  For general use and evaluation, we provide a [Chatbot](https://www.hailuo.ai/) with online search capabilities and the [online API](https://intl.minimaxi.com) for developers.
241
 
242
- Contact us at [[email protected]](mailto:[email protected]).
 
170
  + [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.num_hidden_layers)]
171
  )
172
 
173
+ # assume 8 GPUs
174
+ world_size = 8
175
+ layers_per_device = hf_config.num_hidden_layers // world_size
176
  # set device map
177
  device_map = {
178
  'model.embed_tokens': 'cuda:0',
179
  'model.norm': f'cuda:{world_size - 1}',
180
  'lm_head': f'cuda:{world_size - 1}'
181
  }
 
 
 
182
  for i in range(world_size):
183
  for j in range(layers_per_device):
184
  device_map[f'model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
 
239
  ## 6. Chatbot & API
240
  For general use and evaluation, we provide a [Chatbot](https://www.hailuo.ai/) with online search capabilities and the [online API](https://intl.minimaxi.com) for developers.
241
 
242
+ Contact us at [[email protected]](mailto:[email protected]).