def METHOD_NAME(tmpdir, accum: int):
    model = TestPrecisionModel()
    trainer = Trainer(
        max_epochs=2,
        default_root_dir=tmpdir,
        limit_train_batches=2,
        limit_val_batches=0,
        strategy="ddp_spawn",
        accelerator="gpu",
        devices=2,
        precision="16-mixed",
        # use a tiny value to make sure it works
        gradient_clip_val=1e-3,
        gradient_clip_algorithm="value",
        log_every_n_steps=1,
        accumulate_grad_batches=accum,
        enable_progress_bar=False,
    )
    trainer.fit(model)