Enhancements and bug-fixes
This release includes the following enhancements and bug fixes:
- Supports PyTorch 1.12
- Adds an extension to easily post to Slack using `slack_sdk` or webhook URL (526)
- Allows to export to ONNX modules compiled using `torch.jit.ScriptedModule` (553)
- Support for distributed evaluators (551 thanks belltailjp!)
- Autoselect the correct extensions for `PrintReport` and `ProgressBar` when running in notebooks (525)
- Multiple corrections to PFTO
Using the `Slack` and `SlackWebhook` extensions (526)
It is now possible to report the training process to Slack. For this, two new extensions are provided; `Slack` uses the `slack_sdk` python package and allows to post messages and upload files. `SlackWebhook` is a simpler version that doesn't have any requirements but can only post simple messages.
An example of how to use these extensions is as follows:
python
extensions.Slack(
channel="experiment-progress",
msg="Epoch {manager.epoch}: loss = {val/loss}",
Surround the username with <> to mention.
end_msg="{default} \n <username> Check out the result!",
Upload any artifacts generated during the training.
filenames=['result/statistics.png'],
You can specify when to upload these files.
e.g., only at the final epoch:
upload_trigger=(max_epochs, 'epoch'),
Provide a Slack bot token to access the Slack API.
If not specified env var `SLACK_BOT_TOKEN` will be used.
token=slack_token,
)
Simpler webhook based version
extensions.SlackWebhook(
url="https://hooks.slack.com/services/Txxxxx.....",
msg="Epoch {manager.epoch}: loss = {val/loss}",
end_msg="{default} \n <username> Check out the result!",
)
Backward-incompatible changes
- Drop PyTorch 1.8 support.
- `Extension.finalize` now takes `ExtensionsManager` as an argument (556). Users implementing `finalize` in their own Extension need to be updated.
- ExtensionsManager and Extensions will now be finalized when an error occurs during the Trainer run.
- Remove asynchronous training from Handler (536)
See the list of [merged pull-requests](https://github.com/pfnet/pytorch-pfn-extras/pulls?q=is%3Apr+is%3Aclosed+milestone%3Av0.6.0) for the details.