Skip to main content

Introducing HYSo 0.2.0: An Open-Source Model Engineering Framework for PyTorch

Updated 5 min readMarkdown

Build, analyze, train, benchmark, compare and export PyTorch models with a unified Python framework.

Introducing HYSo

HYSo is an open-source model engineering framework built on PyTorch. It brings model construction, architecture analysis, training, evaluation, performance benchmarking, comparison and export workflows into a single Python library.

I developed HYSo to simplify the process of designing, understanding and evaluating deep learning models without relying on separate tools for every stage of development.

Version 0.2.0 is now available on GitHub and PyPI under the MIT License.

Installation

pip install hyso

To upgrade an existing installation:

pip install --upgrade hyso

1. Modular CNN Architecture Construction

HYSo provides more than 50 modular building blocks for constructing customizable CNN architectures.

Its model construction capabilities include:

  • Convolution modules
  • Attention mechanisms
  • Pooling operations
  • Activation functions
  • Normalization layers
  • Feature transformation modules
  • Classification heads
  • Configurable sequential architectures

A simple model can be created using the ModelBuilder API:

import torch
from hyso import ModelBuilder

model = (
    ModelBuilder((1, 8, 8), 2)
    .conv2d(out_channels=4)
    .relu()
    .build()
)

x = torch.randn(1, 1, 8, 8)

model.eval()

with torch.no_grad():
    output = model(x)

print(model)
print(output.shape)

HYSo models integrate with standard PyTorch workflows.

2. Graph-Based Model Construction

Not every neural network follows a sequential architecture.

HYSo provides graph-based construction capabilities for designing more complex network structures.

These include:

  • Multiple input tensors
  • Parallel processing branches
  • Feature fusion operations
  • Custom connections
  • Non-sequential architectures
  • Modular graph construction

This makes it possible to experiment with different architecture designs without manually implementing every connection from scratch.

3. Model Architecture Analysis

HYSo provides tools for examining existing PyTorch models.

Available analysis capabilities include:

  • Total parameter counts
  • Trainable and non-trainable parameters
  • Layer types and architecture structure
  • Input and output tensor dimensions
  • Model size
  • Memory measurements
  • Layer-level profiling
  • Computational complexity analysis in supported configurations

A fundamental principle of HYSo is non-invasive model analysis.

The analyzer does not rewrite the original model source code, modify its architecture or update its weights.

4. Performance Benchmarking

Model accuracy alone is not enough to evaluate a deep learning architecture.

HYSo provides CPU and GPU performance measurement workflows covering:

  • Inference latency
  • Throughput
  • Batch-size-dependent performance
  • Memory consumption
  • Latency distributions
  • Layer-level execution measurements
  • Hardware-dependent performance characteristics

These measurements help developers understand the practical trade-offs between architectural choices.

5. Evidence-Based Model Advisor

The Model Advisor evaluates available analysis and benchmarking results to identify potential improvement opportunities.

Its recommendations are based on measured results and structural information rather than automatically generated architectural changes.

The advisor helps developers investigate:

  • Computational bottlenecks
  • Memory consumption
  • Parameter efficiency
  • Expensive architectural components
  • Performance limitations
  • Potential optimization opportunities

HYSo provides recommendations while leaving implementation decisions to the developer.

6. Model Comparison

HYSo supports the comparison of different model architectures.

Developers can examine differences in:

  • Total parameters
  • Trainable parameters
  • Layer structure
  • Model size
  • Input and output dimensions
  • Inference latency
  • Throughput
  • Memory consumption
  • Resource utilization

This is particularly useful when evaluating architecture modifications, replacing components or comparing baseline and experimental models.

7. Training and Evaluation

HYSo includes training and evaluation workflows for supported PyTorch model configurations.

Features include:

  • Model training
  • Validation workflows
  • Classification metrics
  • Loss tracking
  • Optimizer configuration
  • Learning rate scheduling
  • Early stopping
  • Checkpoint management
  • Reproducibility controls
  • Training resume in supported configurations

These capabilities complement the model construction and analysis APIs.

8. Model Export

HYSo provides export workflows for supported model configurations.

Available formats and workflows include:

  • ONNX
  • TorchScript
  • torch.export
  • Supported FP16 conversion workflows
  • Supported INT8 quantization workflows

Export capabilities depend on the model architecture, execution environment and selected backend.

Advanced CUDA diagnostics and TensorRT workflows remain subject to additional validation and are not presented as fully supported production features.

9. Multilingual Technical Reporting

HYSo supports technical report generation in four languages:

  • English
  • Turkish
  • German
  • Spanish

Supported report output formats include:

  • JSON
  • Markdown
  • HTML

Reports help developers document experiments, communicate model differences and preserve analysis results.

10. Developer Experience

HYSo 0.2.0 includes extensive public API documentation designed to improve the development experience.

The release includes:

  • More than 1,000 documented public API definitions
  • Detailed parameter descriptions
  • Python type annotations
  • IDE autocompletion support
  • Method signature assistance
  • Public API reference documentation
  • Command-line tools
  • Usage examples

The framework is designed to be accessible from Python scripts, notebooks and development environments such as Visual Studio Code.

Who Is HYSo For?

HYSo is intended for:

  • PyTorch developers
  • Computer vision engineers
  • Deep learning researchers
  • Machine learning engineers
  • CNN architecture developers
  • Students working on deep learning projects
  • Developers interested in model performance and resource efficiency

Release Information

  • Version: 0.2.0
  • Language: Python
  • Framework: PyTorch
  • Supported Python versions: 3.10–3.12
  • PyTorch dependency: >=2.5.1, <2.6
  • License: MIT
  • Distribution: PyPI

Open Source and Contributions

HYSo is an independent open-source project.

Technical feedback, bug reports, feature suggestions and contributions are welcome.

The current release focuses primarily on CNN model engineering and supported PyTorch workflows. Future development will be guided by technical requirements and community feedback.

GitHub Repository

https://github.com/huseyin-dgn/hyso

PyPI Package

https://pypi.org/project/hyso/

Version 0.2.0 Release

https://github.com/huseyin-dgn/hyso/releases/tag/v0.2.0

Installation

pip install hyso

Thank you for reading. If you are working with PyTorch and CNN architectures, I would appreciate your feedback on HYSo and its model engineering capabilities.
\

No comments yet. Be the first to comment.