huggingface / accelerate

🚀 A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and easy-to-configure FSDP and DeepSpeed support
https://huggingface.co/docs/accelerate
Apache License 2.0
7.8k stars 946 forks source link

backticks in `accelerate` #731

Closed deven-gqc closed 2 years ago

deven-gqc commented 2 years ago

Feature request:

Would it possible to include backticks to the source documentation in the docs? Just the way we have it in popular libraries like fastai, numpy, pandas?

muellerzr commented 2 years ago

Hi @deven-gqc! Can you please show an example of where you found this doesn't happen in the docs?

deven-gqc commented 2 years ago

@muellerzr I was under the impression that even the CLI would have the option of seeing the source code

image

muellerzr commented 2 years ago

@deven-gqc since the CLI is a bit of a different functionality than just raw python functions, these can't have autodoc (our documentation rendering system) capabilities and requires manual documentation writing, (sphinx can't render this either), and as a result won't generate a source. This is the same case as the torchrun docs out of PyTorch.

fastai is different because it uses @call_parse (a fastcore capability) to have it be a regular python function, and thus documented as such. We don't depend on fastcore and utilize the standard argparse library instead, which results in this difference.

To see the source for any of the CLI aspects, please explore the commands subfolder in Accelerate: https://github.com/huggingface/accelerate/blob/main/src/accelerate/commands/launch.py

deven-gqc commented 2 years ago

Make sense. Thanks a lot Zach! I'll go ahead and close the issue.