This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Best practice pyproject.toml: | |
# https://github.com/airbytehq/airbyte/blob/master/airbyte-lib/pyproject.toml | |
[tool.coverage.run] | |
include = ["src/*"] | |
parallel = true | |
branch = true | |
[tool.coverage.paths] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check for bash version 4+ (POSIX-compliant) : | |
[ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ] | |
path to script even if symlinked: | |
SCRIPT_DIR="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fast one-liner in current dir: | |
docker run -v $PWD:$PWD -w $PWD --net=[host|none] image cmd | |
Verbose docker info: | |
docker system df -v | |
Delete all build cache: | |
docker builder prune -af | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkeypatch pytorch to run GEMM kernel autotuning on non-enterprise CUDA GPUs | |
# until https://github.com/pytorch/pytorch/issues/109489 is resolved: | |
# Put these 4 lines at the top of the main script, before any imports | |
# TODO: remove once https://github.com/pytorch/pytorch/issues/109489 is resolved | |
from torch._inductor import utils | |
utils._use_template_for_cuda = lambda x, y: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Render markdown cells: | |
from IPython.display import display, Markdown | |
display(Markdown(...)) # e.g. df.to_markdown() | |
Pretty print tensors: | |
import lovely_tensors as lt | |
lt.lovely(...) | |
Rich print: | |
pip install rich |
OlderNewer