Skip to main content

Reduced Inference Fast Transformer (RIFT) audit tool — measures inference efficiency in Transistor Flip Equivalents

Project description

RIFT Audit Tool

Reduced Inference Fast Transformer audit tool — measures inference efficiency in Transistor Flip Equivalents (TFE) across CMOS, Photonic, and Quantum substrates.

Part of the Blundin Space RIFT Competition by QuanTM.ai.

Install

pip install rift-audit

# With HuggingFace model support (required for most models):
pip install rift-audit[transformers]

From source

git clone https://github.com/justinm3434/rift-audit.git
cd rift-audit
pip install -e ".[transformers,dev]"

Quick Start

CLI

# Audit GPT-2 from HuggingFace
rift-audit gpt2 --hellaswag-acc 30.0 --val-loss 3.28

# Save signed JSON report (required for submission)
rift-audit gpt2 --hellaswag-acc 30.0 --val-loss 3.28 --output report.json

# Custom sequence length
rift-audit gpt2 --hellaswag-acc 30.0 --val-loss 3.28 --seq-len 256

The tool will output something like:

Computing model weight hash...
Model hash: a3f8c1d2e4b5...
Auditing gpt2 (seq_len=128, device=cpu)...
Report saved to report.json (signed)

Python API

import torch
from transformers import AutoModelForCausalLM
from rift_audit import RIFTAuditor, compute_rift_scores

# Load model
model = AutoModelForCausalLM.from_pretrained("gpt2")
model.eval()

# Create dummy input
input_ids = torch.randint(0, 50257, (1, 128))

# Audit
auditor = RIFTAuditor()
result = auditor.audit(model, input_ids, model_name="gpt2")

# Score
scores = compute_rift_scores(result, hellaswag_accuracy=30.0, validation_loss=3.28)

print(f"RIFT-Silicon:   {scores.silicon:.4f}")
print(f"RIFT-Photonic:  {scores.photonic:.4f}")
print(f"RIFT-Quantum:   {scores.quantum:.4f}")
print(f"RIFT-Universal: {scores.universal:.4f}")

Scoring

RIFT Score = (HellaSwag_accuracy × 1000) / log10(TFE_per_token)

Higher is better. The numerator rewards intelligence. The denominator penalizes thermodynamic cost on a log scale.

Leaderboard Categories

Category TFE Table Description
RIFT-Silicon v1.0 (CMOS) Current hardware. Win this today.
RIFT-Photonic v2.0 (Photonic) Design for the substrate that's coming.
RIFT-Quantum v3.0 (Quantum) The long game. Radical architectures welcome.
RIFT-Universal Geometric mean The overall champion.

Report Integrity

Every report generated by rift-audit is cryptographically signed using HMAC-SHA256 keyed with a SHA-256 hash of the model's weights. This prevents score tampering — any modification to the JSON invalidates the signature.

Verify a report (signature only)

rift-verify report.json

Full verification (signature + model weights)

rift-verify report.json --model gpt2

Example output:

============================================================
  RIFT REPORT VERIFICATION — Full (signature + model hash)
============================================================

  RESULT: PASS
  Signature valid:    True
  Model hash matches: True
  Reason: Signature valid and model hash matches
============================================================

Python API

from rift_audit import verify_report, compute_model_hash

# Signature-only verification
result = verify_report(report)
print(result["valid"])        # True/False
print(result["reason"])

# Full verification (requires model)
from rift_audit.integrity import verify_model_against_report
result = verify_model_against_report(model, report)
print(result["model_hash_matches"])

TFE Conversion Table

The TFE table maps operations to equivalent transistor state transitions — a substrate-agnostic measure of computational thermodynamic cost. Values are calibrated against published energy data (Horowitz 2014 ISSCC, Stillmaker & Baas 2017).

See the full table and methodology at quantm.ai/competition.

Qualifying Requirements

To appear on the leaderboard, submissions must meet:

Metric Threshold
HellaSwag accuracy ≥ 30.0%
OpenWebText validation loss ≤ 3.28

Submission

Submit to rift@quantm.ai with subject [RIFT Submission] Your Model Name. See quantm.ai/submit for the full guide.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rift_audit-0.1.1.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rift_audit-0.1.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file rift_audit-0.1.1.tar.gz.

File metadata

  • Download URL: rift_audit-0.1.1.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for rift_audit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 af8ef16784374fab169044367d87ba6811a4994e87602e6a701e69d2b2894e85
MD5 9ffde87158bdc5e3f321737f4265fc2e
BLAKE2b-256 ef5c85de4ded5c9c85bbeaae087a0647eecd28d16a8d88a5c07a78bf0de1d13b

See more details on using hashes here.

File details

Details for the file rift_audit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rift_audit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for rift_audit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b74f6ec777a3de9274dd2e5cfd096d39963c12d545e398216db4fb571c06898
MD5 3b414fc68f2eec8570835fb31c6bc38a
BLAKE2b-256 1c8173d8d4a56b88bf8502db4962e4566ed95aabc65a20fd761d6e0bd41dd42c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page