absl-extra


Nameabsl-extra JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryA wrapper to run and monitor absl app.
upload_time2023-10-20 13:46:39
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### 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

```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "absl-extra",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Artem Sereda <artem.sereda.tub@gmail.com>",
    "keywords": "",
    "author": "",
    "author_email": "Artem Sereda <artem.sereda.tub@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/73/bd/e340ca0f2fde4912f9710d10bf83e209711952abdd8ab99e95f3e3a6f989/absl_extra-0.1.3.tar.gz",
    "platform": null,
    "description": "### ABSL-Extra\n\nA collection of utils I commonly use for running my experiments.\nIt will:\n- Notify on execution start, finish or failed.\n  - By default, Notifier will just log those out to `stdout`.\n  - I prefer receiving those in Slack, though (see example below).\n- Log parsed CLI flags from `absl.flags.FLAGS` and config values from `config_file:get_config()`\n- Select registered task to run based on --task= CLI argument.\n\nMinimal example\n\n```python\nimport os\nfrom absl import logging\nimport tensorflow as tf\n\nfrom absl_extra import tf_utils, tasks, notifier\n\n\n@tasks.register_task(\n    notifier=notifier.SlackNotifier(slack_token=os.environ[\"SLACK_BOT_TOKEN\"], channel_id=os.environ[\"CHANNEL_ID\"])\n)\n@tf_utils.requires_gpu\ndef main() -> None:\n    if tf_utils.supports_mixed_precision():\n        tf.keras.mixed_precision.set_global_policy(\"mixed_float16\")\n    \n    with tf_utils.make_gpu_strategy().scope():\n        logging.info(\"Doing some heavy lifting...\")\n\n\nif __name__ == \"__main__\":\n    tasks.run()\n```\n\n#### `flax_utils.py`\n- Common utilities used for training flax models, which I got tired of copy-pasting in every project.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A wrapper to run and monitor absl app.",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/aaarrti/absl_extra"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e613eec46f949977dcf25dcb5d67c594bf01af0d1a4881ae7f70fbff2353b43c",
                "md5": "bd301903732c83afbe49d9d6a8bd3e9e",
                "sha256": "ab974a2ba40a9a515b8f20ba14955e5bda38ee55655b23e5ad6cf2ed2a562358"
            },
            "downloads": -1,
            "filename": "absl_extra-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd301903732c83afbe49d9d6a8bd3e9e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16498,
            "upload_time": "2023-10-20T13:46:38",
            "upload_time_iso_8601": "2023-10-20T13:46:38.114072Z",
            "url": "https://files.pythonhosted.org/packages/e6/13/eec46f949977dcf25dcb5d67c594bf01af0d1a4881ae7f70fbff2353b43c/absl_extra-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73bde340ca0f2fde4912f9710d10bf83e209711952abdd8ab99e95f3e3a6f989",
                "md5": "aee49149af7cd1bf4380ae09daa5ea9d",
                "sha256": "c1bc927febee852a40193763d4453632fb74c482fb0c5faf34e19a56e2cb6009"
            },
            "downloads": -1,
            "filename": "absl_extra-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "aee49149af7cd1bf4380ae09daa5ea9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13740,
            "upload_time": "2023-10-20T13:46:39",
            "upload_time_iso_8601": "2023-10-20T13:46:39.716425Z",
            "url": "https://files.pythonhosted.org/packages/73/bd/e340ca0f2fde4912f9710d10bf83e209711952abdd8ab99e95f3e3a6f989/absl_extra-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-20 13:46:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aaarrti",
    "github_project": "absl_extra",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "absl-extra"
}
        
Elapsed time: 0.14495s