Torch and CUDA helper toolkit for AI training and inference workflows.
Project description
coremate
CoreMate is a lightweight Python toolkit focused on Torch and CUDA optimization for AI workflows.
PyPI release page:
https://pypi.org/project/coremateai/0.1.2/
Installation
pip install coremateai==0.1.2
Optional extras:
pip install "coremateai[ai]"
Install PyTorch separately (matching your CUDA runtime):
pip install torch
What It Does
- Detects AI stack details (
torch, CUDA, GPU, driver). - Recommends training presets by task (
cv,nlp,llm, etc.). - Builds full training plans (
build_training_plan) with LR, batch and accumulation heuristics. - Applies reproducibility helpers (
set_global_seed). - Tunes Torch runtime (
cudnn, TF32, matmul precision, threads). - Applies CUDA allocator/env defaults.
- Provides one-shot optimization (
optimize_torch_cuda). - Includes a trainable demo AI model (
demo intent classifier) with checkpoint + prediction flow.
Python Usage
from coremate import (
detect_ai_stack,
recommend_training_preset,
build_training_plan,
set_global_seed,
tune_torch_runtime,
apply_cuda_env_defaults,
optimize_torch_cuda,
)
stack = detect_ai_stack()
print(stack["cuda_available"], stack["torch_version"])
preset = recommend_training_preset(task="llm", aggressive=True, hardware=stack)
print(preset.batch_size, preset.precision)
plan = build_training_plan(
task="llm",
model_scale="base",
target_global_batch_size=64,
aggressive=True,
hardware=stack,
)
print(plan.global_batch_size, plan.learning_rate)
set_global_seed(42, deterministic=True)
apply_cuda_env_defaults(max_split_size_mb=256, expandable_segments=True)
tune_torch_runtime(seed=42, deterministic=True, benchmark=True, allow_tf32=True)
result = optimize_torch_cuda(
task="llm",
model_scale="base",
target_global_batch_size=64,
aggressive=True,
seed=42,
deterministic=True,
)
print(result["plan"]["global_batch_size"], result["tune_error"])
Demo AI (Train + Predict)
coremate ai demo-train --output artifacts/demo_intent.pt --epochs 120 --batch-size 8
coremate ai demo-predict --model artifacts/demo_intent.pt --text "hello can you help me"
The demo model is a small NLP intent classifier (greet, help, train, bye, gpu) meant as a starter you can extend.
Create New AI Project Automatically
coremate ai create coremateai --path .
This command generates a ready starter project folder with:
pyproject.tomlREADME.mdtrain.pypredict.pyconfig.jsonsrc/<package>/__init__.pyartifacts/.gitkeep
Example:
coremate ai create myawesomeai
cd myawesomeai
pip install -e .[dev]
python train.py
python predict.py --text "hello can you help me"
CLI Usage
coremate ai report
coremate ai recommend --task llm --aggressive
coremate ai plan --task llm --model-scale base --target-global-batch 64 --aggressive
coremate ai seed --seed 42 --deterministic
coremate ai env --max-split-size-mb 256 --expandable-segments
coremate ai tune --seed 42 --deterministic --benchmark --allow-tf32
coremate ai optimize --task llm --model-scale base --target-global-batch 64 --aggressive --seed 42 --deterministic
coremate ai create myawesomeai
Testing
python -m pytest
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coremateai-0.1.2.tar.gz.
File metadata
- Download URL: coremateai-0.1.2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0eb2f9ecf6f6c3d84fbe2fa3cebb5c4549d685ac4007a791ecc89dc8a89a09f
|
|
| MD5 |
b0dad00ab19d0218a348daee060d606e
|
|
| BLAKE2b-256 |
d802db27f9cff68994c51e6c922ffb8445e9c7e51f4422ef4b0e5ef47242788c
|
File details
Details for the file coremateai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: coremateai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1d93b4595827ea7b070171b1d03732c4366290c712109a35d4374383fb94f89
|
|
| MD5 |
e4cbdc4b6e0432505cfdd5162b3725e6
|
|
| BLAKE2b-256 |
a966e00a6c06b54c47968b0b1596a14c99f103afd1862039e89be82882b68b06
|