Skip to main content

Younger-Logics-IR

Younger - Logics - Intermediate Representation

Younger-Logics-IR is a submodule of the Younger project designed to construct a unified Intermediate Representation (IR) for abstracting and describing the logic structure of deep learning models. It supports extracting model information from various frameworks (e.g., PyTorch and ONNX) and abstracts the operators and data flows into a unified graph structure. Younger-Logics-IR enables framework-agnostic model analysis, conversion, and optimization, serving as a foundational tool for deep learning workflows.

Contributing

This repository is a submodule of the parent project. For the canonical workflow and submodule pointer rules, see CONTRIBUTING.md.

If you are working inside a parent clone:

  • Commit changes in this submodule repo and open a PR to the submodule upstream.
  • Do not update the parent repo submodule pointer unless a maintainer asks; mention any required pointer bump in your PR description.

If you are working standalone:

  • Fork this repo, add upstream, create a feature branch, then open a PR back to upstream.

Git workflow (sync with upstream)

# 1) Sync with upstream
git remote -v               # confirm origin/upstream are set correctly
git fetch --prune upstream   # sync upstream refs and drop deleted branches
git checkout dev             # ensure you are on the main dev branch
git pull --rebase upstream dev  # replay local dev on top of upstream/dev

# If you keep local commits on dev, rebase explicitly:
git rebase upstream/dev      # same as above, but explicit and easier to debug
# If conflicts happen:
git status                   # see which files are conflicted
# resolve files, then
git add <conflicted-file>    # mark conflicts as resolved
git rebase --continue        # continue replaying commits
# to abort:
git rebase --abort           # roll back to pre-rebase state

# 2) Create a feature branch
git checkout -b feat/my-change

# 3) Make changes and commit
git add .
git commit -m "feat: my change"

# 4) Push to your fork
git push origin feat/my-change

Fixing edits made on a detached HEAD

If you forgot to switch branches and edited files on a Previous HEAD position, stash the changes, switch to the target branch, then restore them:

# 1) Stash the current changes
git stash push -m "temp: bench local edits"

# 2) Switch to dev
git checkout dev

# 3) Restore the changes
git stash pop

Local development

From this repo root:

# 1) Install with dev tools
pip install -e .[develop]

# 2) Run tests
pytest tests

Common commands

younger-logics-ir --help
younger logics ir create onnx retrieve huggingface \
    --mode Metric_Infos \
    --save-dirpath /path/to/working_directory/ \
    --token <HF_API_TOKEN> \
    --number-per-file 100000 \
    --logging-filepath /path/to/working_directory/.younger.log

More docs

Optional Dependencies (Extras)

This package defines several optional dependency groups for different scripts/tools.

Install an extra with:

pip install "younger-logics-ir[EXTRA_NAME]"

Available extras:

  • scripts-hubs-hf: Crawl models and metadata from Hugging Face Hub and build Younger IR-Dataset (FromONNX). Each sample is organized as LogicX or Instance (DAG + related info).
  • scripts-hubs-ox: Crawl models and metadata from the ONNX Model Zoo. This is no longer maintained since most models moved to Hugging Face Hub.
  • scripts-hubs-tr: Crawl models and metadata from Torch Hub. This hub contains very few models compared to Hugging Face Hub.
  • scripts-hubs: Full hub stack (combined set).
  • scripts-bootstrap: Filter, normalize, post-process, and some other feature engineering on collected DAG datasets.
  • tools-vs: Visualize DAGs (Graphviz).
  • tools: Full toolset (combined set).
  • develop: Developer tools (docs, pytest, release tooling).

For the Use of Assorts

Requirements

Graphviz must be installed:

  • Mac
brew install graphviz
  • Debian/Ubuntu
sudo apt install graphviz
  • Conda
conda install conda-forge::python-graphviz
Usage
younger logics ir create onnx retrieve huggingface \
    --mode Metric_Infos \
    --save-dirpath /path/to/working_directory/ \
    --token <HF_API_TOKEN> \
    --number-per-file 100000 \
    --logging-filepath /path/to/working_directory/.younger.log

Releases

This repository publishes its Python package independently to GitHub and PyPI. The release version is defined in pyproject.toml; a matching v<version> tag runs .github/workflows/release.yml. Pull requests and manual runs validate the build without publishing. Internal dependency bounds declare which Younger and component versions are compatible.

Before the first release, configure the PyPI Trusted Publisher for this repository, workflow release.yml, and GitHub environment pypi. Publish required Younger/IR versions before dependent packages. See the Younger release guide for setup, dependency order, and combination validation. Conda distribution is deferred.

Metadata

Release files for Younger-Logics-IR 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Younger-Logics-IR 0.1.0
File Size Uploaded
younger_logics_ir-0.1.0.tar.gz 93.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Younger-Logics-IR 0.1.0
File Interpreter ABI Platform
younger_logics_ir-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 213.1 kB

Release files / younger_logics_ir-0.1.0.tar.gz

Download URL younger_logics_ir-0.1.0.tar.gz
Size 93.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2b86b9b3c684085b3a0fce1ae62b093b4e69c39e551cca32cd4ad9a83a159131
BLAKE2b-256 checksum
How to use checksums
9503c9824ab920046550336b5adc6ff077ee7c44c72fa3fba07d889211e79bc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / younger_logics_ir-0.1.0-py3-none-any.whl

Download URL younger_logics_ir-0.1.0-py3-none-any.whl
Size 120.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d75271df344ea8f56c867c20949c69e1918895969c2cc8c832475031b54ca4c
BLAKE2b-256 checksum
How to use checksums
6968974184a4d02d98124c474aea33210258783d6123c72ce4f2b28d91173e2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page