def test_tp_train_with_one_gpu(tmp_path: Path, tiny_text_dataset_path: Path):
    """Test that when we have one GPU, we train DDP and not FSDP-TP."""
    # Make `train_cfg`` with a tensor parallelism strategy
    train_cfg = gpt_tiny_cfg(str(tiny_text_dataset_path), 'gpu')
    train_cfg.tp_config = {'strategy': 'ffn'}

    # Expect a warning
    with pytest.warns(
        UserWarning,
        match=
        r'FSDP\+TP is not applicable for single-GPU training. Reverting to DDP.',
    ):
        train(train_cfg)
Test that when we have one GPU, we train DDP and not FSDP-TP.
tests/tp/test_tp_strategies.py