/ Модель

Характеристики

Контекст
512 токенов
Параметры
155 млн
Лицензия
MIT
Архитектура
deberta-v2 · dense
Базовая модель
deberta-v3-small
Библиотека
transformers
Опубликована
29 авг 2026

autopragma

Классификация текстаТекст → label3 профессии

AutoPragma классифицирует циклы for в коде C/C++ и подсказывает, стоит ли проверить их на возможность параллелизации с OpenMP.

105скачиваний за 30 дней1лайквеса обновлены29 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

AutoPragma — модель-классификатор, разработанная в рамках исследовательской стажировки в Centre for Development of Advanced Computing (C-DAC), Бангалор. Она дообучена на базе microsoft/deberta-v3-small и анализирует текст циклов for на C/C++, чтобы оценить, похожи ли они на циклы, которым разработчики обычно добавляют директиву параллелизации OpenMP. Модель содержит около 155 млн параметров, использует архитектуру DeBERTa V2 для классификации последовательностей и принимает до 512 токенов текста на вход. Поддерживается английский язык исходного кода.

AutoPragma предназначена для предварительного отбора циклов в инструментах статического анализа и для помощи разработчикам при поиске участков кода, которые стоит проверить на возможность параллелизации. Это рекомендательная оценка, а не доказательство безопасности преобразования: модель видит только текст цикла, не учитывает граф зависимостей, алиасинг и контекст окружающей функции, а также не генерирует директиву с клаузами private или reduction. В README отмечено заметное ухудшение на SPEC OMP и чувствительность к сдвигу распределения данных; ложная рекомендация может привести к гонке данных, поэтому результат требует проверки человеком или статическим анализатором. Лицензия — MIT.

Сценарии применения

  • поиск циклов C/C++, которые стоит проверить на параллелизацию OpenMP
  • предварительная сортировка циклов для ревью разработчиком
  • анализ циклов в HPC-бенчмарках
  • оценка вероятности наличия OpenMP-директивы в коде
  • исследование автоматизации параллелизации программ

Ограничения

Модель оценивает наличие прагмы OpenMP по тексту цикла, а не доказывает безопасность параллелизации; ложноположительная рекомендация может вызвать гонку данных. На нерегулярном реальном коде и при сдвиге распределения меток качество снижается, поэтому выводы требуют проверки и калибровки на целевом коде.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

AutoPragma — OpenMP Parallelization Advisor

A microsoft/deberta-v3-small model fine-tuned to read a C/C++ for loop and predict whether it should carry an OpenMP parallelization pragma.

Trained during a research internship at the Centre for Development of Advanced Computing (C-DAC), Bangalore (March–September 2025), on a project titled AI-Based Auto-Parallelization.

Code, datasets and evaluation scripts: https://github.com/Harshagrawal526/AutoPragma

What it does

Static dependence analysis is exact but conservative — pointer aliasing, opaque function calls and irregular indexing all force a compiler to decline, leaving loops serial that are parallel in practice. This model asks a different question: not can we prove this loop is independent? but does this loop look like the kind a human expert parallelizes?

It is a binary classifier over loop text. It is an advisory tool, not a proof — see Limitations.

Usage

from transformers import pipeline

clf = pipeline("text-classification", model="Harshagrawal526/autopragma")

clf("for (int i = 0; i < N; i++) { c[i] = a[i] + b[i]; }")
# -> [{'label': 'LABEL_1', 'score': ...}]   LABEL_1 = should be parallelized

Label mapping

The model was trained without explicit label names, so the config carries the HF defaults:

LabelMeaning
LABEL_0Not parallelized — no OpenMP pragma
LABEL_1Parallelized — carries an OpenMP pragma

Inputs are truncated at 512 tokens, so pass the loop, not the whole translation unit.

Results

Evaluated on a held-out split of the training distribution, then on three HPC benchmark suites the model never saw during training.

BenchmarkLoopsAccuracyPrecisionRecallF1Majority baseline
Held-out test (open-omp-plus)5,29681.4%81.7%72.7%0.76957.4%
NAS Parallel Benchmarks31279.5%75.3%91.6%0.82653.2%
PolyBench14887.8%85.7%85.7%0.85757.4%
SPEC OMP1,15782.5%39.9%56.7%0.46886.4%

Positive class = "should be parallelized". Majority baseline = accuracy from always predicting the more common class in that set.

Reading these numbers honestly

PolyBench is the best case, and that follows from its content: dense, affine, regular nested loops — stencils and matrix kernels — which is the shape the training data is dominated by.

NAS exposes the model's bias. Recall 91.6% against precision 75.3%: it finds nearly every parallel loop while over-flagging serial ones. For an advisory tool a developer reviews before acting, over-suggesting is the cheaper error — but it is still a cost.

SPEC OMP is where it fails, and it is the row that matters most. 82.5% accuracy looks fine in isolation, but only 13.6% of SPEC loops are positive against 42.7% in training — so a model that answered "no" every time would score 86.4% and beat this one. Precision falls to 39.9%: three of every five parallel suggestions are wrong.

That is the honest finding of the project. The model learned the loop shapes common in its training corpus rather than a transferable notion of parallelizability, and it degrades exactly where the label distribution shifts and the code is real, large and irregular rather than benchmark-shaped.

Training

Base modelmicrosoft/deberta-v3-small
TaskBinary sequence classification
Datasetopen-omp-plus — 42,360 train / 5,295 validation / 5,296 test
Class balance42.7% positive (train)
Learning rate2e-5
Batch size16
Epochs3
Weight decay0.01
Max sequence length512 tokens
Checkpoint selectionBest validation loss, evaluated each epoch

Limitations

The label is a proxy. It records whether a pragma exists in the original source, not whether one should. A perfectly parallelizable loop that ran cold enough that nobody bothered annotating it is labelled negative. Part of what the model learned is therefore developer annotation habit rather than parallelism — and habits differ between codebases, which plausibly contributes to the SPEC result above.

It sees flat text. No dependence graph, no aliasing information, no view of what the enclosing function does. A structured representation (AST or IR-level) is the natural next step.

It says whether, not how. The source dataset carries private and reduction clause information that this model does not use. Generating a complete pragma is the more useful and much harder task.

A false positive is a data race. Nothing here proves a transformation is safe. Any output needs human review or static-analysis confirmation before it is acted on. Do not wire this into a build.

Distribution shift is unaddressed. If you apply this to a codebase whose parallel-loop rate differs much from 42.7%, calibrate the decision threshold on a labelled sample of that codebase first.

Credits

Developed during an internship at C-DAC Bangalore, March–September 2025. Benchmark suites are the work of their respective authors: NAS Parallel Benchmarks (NASA Advanced Supercomputing Division), PolyBench (Louis-Noël Pouchet), and SPEC OMP (Standard Performance Evaluation Corporation).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
DebertaV2ForSequenceClassification
Ревизия весов
6bb9a59

0 моделей