Skip to content

Fabric run CLI cannot launch python module #20654

@jhliu17

Description

@jhliu17

Description & Motivation

In Fabric run CLI, the script argument always assumes the input is an existed file path. However, users might need to launch a python module.

type=click.Path(exists=True),

For example, the CLI expects

fabric run src/run.py \
    --strategy=ddp \
    --devices=2 \
    --accelerator=cuda

However, this would fail

fabric run \
    --strategy=ddp \
    --devices=2 \
    --accelerator=cuda \
    -m src.run

In huggingface accelearte, they provide an extra argument for definiing an module
https://github.com/huggingface/accelerate/blob/4b6be8991059f39a8df8893333d11c54bc51fc60/src/accelerate/commands/launch.py#L358

Pitch

No response

Alternatives

No response

Additional context

No response

cc @lantiga @Borda @justusschock

Metadata

Metadata

Assignees

Labels

fabriclightning.fabric.FabricfeatureIs an improvement or enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions