# Accelerate config in Seq2SeqTrainer

**URL:** <https://discuss.huggingface.co/t/accelerate-config-in-seq2seqtrainer/92626>\
**Category:** 🤗Accelerate\
**Created:** [June 17, 2024, 7:08pm UTC](https://discuss.huggingface.co/t/accelerate-config-in-seq2seqtrainer/92626 "2024-06-17T19:08:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghavm1](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@raghavm1](https://discuss.huggingface.co/u/raghavm1)\
**Post date:** [June 17, 2024, 7:08pm UTC](https://discuss.huggingface.co/t/accelerate-config-in-seq2seqtrainer/92626/1 "2024-06-17T19:08:17Z")

</div>

I’m trying to use `accelerate` in an HPC system where I schedule jobs using SLURM.  
Usually for such models from Huggingface, do we always need to mention the configuration we created for accelerate into the `accelerator_config` argument like this? -

```auto
    trainer = Seq2SeqTrainer(
        model,
accelerator_config="path/to/config/accelerate/default_config.yaml",
        compute_metrics=lambda eval_pred: compute_metrics(eval_pred, tokenizer)
    )

```

Or just specifying the arguments when running the python script will suffice?

Like this -

`accelerate launch --num_processes $(( 4 * $SLURM_NNODES )) --num_machines $SLURM_NNODES --multi_gpu --mixed_precision fp16 --main_process_ip $MASTER_ADDR --main_process_port $MASTER_PORT samplescript.py`

I’m a bit new to this package. I’m confused about the usage of accelerate when it comes to using it from Seq2SeqTrainer or other models from the transformers package.

Any help appreciated! Thank you!
