mirror of
https://github.com/clearml/clearml-docs
synced 2025-03-03 18:53:37 +00:00
Add LightningCLI information (#719)
This commit is contained in:
parent
346d1fc558
commit
c54ab774f3
BIN
docs/img/integrations_lightningcli_params.png
Normal file
BIN
docs/img/integrations_lightningcli_params.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
@ -8,7 +8,8 @@ instructions.
|
|||||||
:::
|
:::
|
||||||
|
|
||||||
[PyTorch Lightning](https://github.com/Lightning-AI/lightning) is a framework that simplifies the process of training and deploying PyTorch models. ClearML seamlessly
|
[PyTorch Lightning](https://github.com/Lightning-AI/lightning) is a framework that simplifies the process of training and deploying PyTorch models. ClearML seamlessly
|
||||||
integrates with PyTorch Lightning, automatically logging PyTorch models and more.
|
integrates with PyTorch Lightning, automatically logging PyTorch models, parameters supplied by [LightningCLI](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli.html),
|
||||||
|
and more.
|
||||||
|
|
||||||
All you have to do is simply add two lines of code to your PyTorch Lightning script:
|
All you have to do is simply add two lines of code to your PyTorch Lightning script:
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ And that’s it! This creates a [ClearML Task](../fundamentals/task.md) which ca
|
|||||||
* Source code and uncommitted changes
|
* Source code and uncommitted changes
|
||||||
* Installed packages
|
* Installed packages
|
||||||
* PyTorch Models
|
* PyTorch Models
|
||||||
|
* Parameters supplied by [LightningCLI](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli.html) (when class is instantiated in script)
|
||||||
* [TensorBoard](https://www.tensorflow.org/tensorboard) outputs
|
* [TensorBoard](https://www.tensorflow.org/tensorboard) outputs
|
||||||
* Console output
|
* Console output
|
||||||
* General details such as machine details, runtime, creation date etc.
|
* General details such as machine details, runtime, creation date etc.
|
||||||
@ -28,12 +30,15 @@ And that’s it! This creates a [ClearML Task](../fundamentals/task.md) which ca
|
|||||||
|
|
||||||
You can view all the task details in the [WebApp](../webapp/webapp_overview.md).
|
You can view all the task details in the [WebApp](../webapp/webapp_overview.md).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
See an example of PyTorch Lightning and ClearML in action [here](../guides/frameworks/pytorch_lightning/pytorch_lightning_example.md).
|
See an example of PyTorch Lightning and ClearML in action [here](../guides/frameworks/pytorch_lightning/pytorch_lightning_example.md).
|
||||||
|
|
||||||
## Automatic Logging Control
|
## Automatic Logging Control
|
||||||
By default, when ClearML is integrated into your script, it automatically captures information from supported frameworks.
|
By default, when ClearML is integrated into your script, it automatically captures information from supported frameworks,
|
||||||
But, you may want to have more control over what your experiment logs.
|
and parameters from supported argument parsers. But, you may want to have more control over what your experiment logs.
|
||||||
|
|
||||||
|
### Frameworks
|
||||||
To control a task's framework logging, use the `auto_connect_frameworks` parameter of [`Task.init()`](../references/sdk/task.md#taskinit).
|
To control a task's framework logging, use the `auto_connect_frameworks` parameter of [`Task.init()`](../references/sdk/task.md#taskinit).
|
||||||
Completely disable all automatic logging by setting the parameter to `False`. For finer grained control of logged
|
Completely disable all automatic logging by setting the parameter to `False`. For finer grained control of logged
|
||||||
frameworks, input a dictionary, with framework-boolean pairs.
|
frameworks, input a dictionary, with framework-boolean pairs.
|
||||||
@ -61,6 +66,30 @@ unspecified frameworks' values default to true so all their models are automatic
|
|||||||
auto_connect_frameworks={'pytorch' : '*.pt'}
|
auto_connect_frameworks={'pytorch' : '*.pt'}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Argument Parsers
|
||||||
|
To control a task's logging of parameters from argument parsers, use the `auto_connect_arg_parser` parameter of [`Task.init()`](../references/sdk/task.md#taskinit).
|
||||||
|
Completely disable all automatic logging by setting the parameter to `False` (this includes disabling logging of `LightningCLI` parameters).
|
||||||
|
|
||||||
|
```python
|
||||||
|
auto_connect_arg_parser=False
|
||||||
|
```
|
||||||
|
|
||||||
|
For finer grained control of logged parameters, input a dictionary with parameter-boolean pairs. The `False` value
|
||||||
|
excludes the specified parameter. Unspecified parameters default to `True`.
|
||||||
|
|
||||||
|
For example, the following code will not log the `Example_1` parameter, but will log all other arguments.
|
||||||
|
|
||||||
|
```python
|
||||||
|
auto_connect_arg_parser={"Example_1": False}
|
||||||
|
```
|
||||||
|
|
||||||
|
To exclude all unspecified parameters, set the `*` key to `False`. For example, the following code will log **only** the
|
||||||
|
`Example_2` parameter.
|
||||||
|
|
||||||
|
```python
|
||||||
|
auto_connect_arg_parser={"Example_2": True, "*": False}
|
||||||
|
```
|
||||||
|
|
||||||
## Manual Logging
|
## Manual Logging
|
||||||
To augment its automatic logging, ClearML also provides an explicit logging interface.
|
To augment its automatic logging, ClearML also provides an explicit logging interface.
|
||||||
|
|
||||||
@ -114,4 +143,8 @@ re-run it on a remote machine.
|
|||||||
task.execute_remotely(queue_name='default', exit_process=True)
|
task.execute_remotely(queue_name='default', exit_process=True)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Hyperparameter Optimization
|
||||||
|
Use ClearML’s [`HyperParameterOptimizer`](../references/sdk/hpo_optimization_hyperparameteroptimizer.md) class to find
|
||||||
|
the hyperparameter values that yield the best performing models. See [Hyperparameter Optimization](../fundamentals/hpo.md)
|
||||||
|
for more information.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user