Skip to main content

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).
  • Log parsed CLI flags from absl.flags.FLAGS and config values from config_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.2.dev12.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

absl_extra-0.1.2.dev12-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file absl_extra-0.1.2.dev12.tar.gz.

File metadata

  • Download URL: absl_extra-0.1.2.dev12.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for absl_extra-0.1.2.dev12.tar.gz
Algorithm Hash digest
SHA256 e0e6b10a4197be661fa4bece7fa654f691bc3692a3cb92bc35a6a214bd34a603
MD5 ba4aaaf66f5d62ba3aac308ab4c244c8
BLAKE2b-256 27493fb76c382fd9f475abe94d5737942e12c69c7b46571f7671f02f6e0c2b0d

See more details on using hashes here.

File details

Details for the file absl_extra-0.1.2.dev12-py3-none-any.whl.

File metadata

File hashes

Hashes for absl_extra-0.1.2.dev12-py3-none-any.whl
Algorithm Hash digest
SHA256 68233d457949c91b3960897359e03aafc57fa2d68f299b4d066b5c8d48f25902
MD5 2c9d185982579ac7f97b37c38548b04d
BLAKE2b-256 a5fbd98a5cf2caf60fdc142b8746f5e6699dfff8d5ce163a6780c22970cc6858

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page