A wrapper to run and monitor absl app.
Project description
ABSL-Extra
A collection of utils I commonly use for running my experiments. It will:
- Notify on execution start, finish or failed.
- By default, Notifier will just log those out to
stdout
. - I prefer receiving those in Slack, though (see example below).
- By default, Notifier will just log those out to
- Log parsed CLI flags from
absl.flags.FLAGS
and config values fromconfig_file:get_config()
- Select registered task to run based on --task= CLI argument.
Minimal example
import os
from absl import logging
import tensorflow as tf
from absl_extra import tf_utils, tasks, notifier
@tasks.register_task(
notifier=notifier.SlackNotifier(slack_token=os.environ["SLACK_BOT_TOKEN"], channel_id=os.environ["CHANNEL_ID"])
)
@tf_utils.requires_gpu
def main() -> None:
if tf_utils.supports_mixed_precision():
tf.keras.mixed_precision.set_global_policy("mixed_float16")
with tf_utils.make_gpu_strategy().scope():
logging.info("Doing some heavy lifting...")
if __name__ == "__main__":
tasks.run()
flax_utils.py
- Common utilities used for training flax models, which I got tired of copy-pasting in every project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
absl_extra-0.1.1.tar.gz
(12.4 kB
view hashes)
Built Distribution
absl_extra-0.1.1-py3-none-any.whl
(14.7 kB
view hashes)
Close
Hashes for absl_extra-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 621331137153ec2b3c482d4ca6190fdc9e370e04afd915a05b3f3857cee25d4c |
|
MD5 | e99b8abdd624ed00056dc8802a481e55 |
|
BLAKE2b-256 | 2b113babf3da95348448a3c642e98d1e4f30c3d7e4d38471f411c90abeb63b94 |