MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / _add_training_args

Function _add_training_args

DeepSpeedExample/megatron/arguments.py:255–301  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

253
254
255def _add_training_args(parser):
256 group = parser.add_argument_group(title='training')
257
258 group.add_argument('--batch-size', type=int, default=None,
259 help='Batch size per model instance (local batch size). '
260 'Global batch size is local batch size times data '
261 'parallel size.')
262 group.add_argument('--checkpoint-activations', action='store_true',
263 help='Checkpoint activation to allow for training '
264 'with larger models, sequences, and batch sizes.')
265 group.add_argument('--distribute-checkpointed-activations',
266 action='store_true',
267 help='If set, distribute checkpointed activations '
268 'across model parallel group.')
269 group.add_argument('--checkpoint-num-layers', type=int, default=1,
270 help='chunk size (number of layers) for checkpointing.')
271 group.add_argument('--train-iters', type=int, default=None,
272 help='Total number of iterations to train over all '
273 'training runs.')
274 group.add_argument('--train-tokens', type=int, default=None,
275 help='Total number of tokens to train over all '
276 'training runs.')
277 group.add_argument('--log-interval', type=int, default=100,
278 help='Report loss and timing interval.')
279 group.add_argument('--exit-interval', type=int, default=None,
280 help='Exit the program after the iteration is divisible '
281 'by this value.')
282 group.add_argument('--tensorboard-dir', type=str, default=None,
283 help='Write TensorBoard logs to this directory.')
284 group.add_argument('--scaled-upper-triang-masked-softmax-fusion',
285 action='store_true',
286 help='Enable fusion of query_key_value_scaling '
287 'time (upper diagonal) masking and softmax.')
288 group.add_argument('--scaled-masked-softmax-fusion',
289 action='store_true',
290 help='Enable fusion of query_key_value_scaling '
291 'general masking and softmax.')
292 group.add_argument('--bias-gelu-fusion', action='store_true',
293 help='Enable bias and gelu fusion.')
294 group.add_argument('--bias-dropout-fusion', action='store_true',
295 help='Enable bias and dropout fusion.')
296
297 group.add_argument('--cpu-optimizer', action='store_true',
298 help='Run optimizer on CPU')
299 group.add_argument('--cpu-torch-adam', action='store_true',
300 help='Use Torch Adam as optimizer on CPU.')
301 return parser
302
303
304def _add_initialization_args(parser):

Callers 1

parse_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected