AI Slop Code RIsk Monitor

NVIDIA/apex

A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch

9.2 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for NVIDIA/apex, a Python project with 9,004 GitHub stars. SynthScan examined 53,634 lines of code across 243 source files, recording 423 pattern matches distributed across 17 syntactic categories. The legacy adjusted pattern signal is 9.2 (Moderate pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

9.2
Adjusted Signal
9.2
Raw Pattern Score
100%
Time Factor
2026-10-05
Last Push
9.0K
Stars
Python
Language
53.6K
Lines of Code
243
Files
423
Pattern Hits
2026-10-12
Scan Date
0.06
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 25.5/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 295 finding(s).

Hallucinated Dependency & Supply Chain Risk 8.3/100 · LOW

Are imports declared and package/API names verified? 97 finding(s).

Agent Over-Engineering Ratio 21.4/100 · LOW

Are wrappers, guards, and repeated structures necessary? 197 finding(s).

PR Review Velocity Impact 38.8/100 · MEDIUM

Which changes need focused human review? 423 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 15MEDIUM 14LOW 394

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 423 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers147 hits · 156 pts
SeverityFileLineSnippetContext
LOWsetup.py64def get_cuda_bare_metal_version(cuda_dir):CODE
LOWsetup.py73def check_cuda_torch_binary_vs_bare_metal(cuda_dir):CODE
LOWsetup.py101def check_cudnn_version_and_warn(global_option: str, required_cudnn_version: int) -> bool:CODE
LOWapex/__init__.py19def check_cudnn_version_and_warn(global_option: str, required_cudnn_version: int) -> bool:CODE
LOWapex/_autocast_utils.py22def _cast_if_autocast_enabled(*args):CODE
LOWapex/normalization/fused_layer_norm.py80 def fused_layer_norm_affine_fwd(CODE
LOWapex/normalization/fused_layer_norm.py101 def fused_layer_norm_affine_fwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py125 def fused_layer_norm_affine_bwd(CODE
LOWapex/normalization/fused_layer_norm.py150 def fused_layer_norm_affine_bwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py166 def _fused_layer_norm_affine_backward(ctx, grad_output, grad_mean, grad_invvar):CODE
LOWapex/normalization/fused_layer_norm.py182 def _fused_layer_norm_affine_setup_context(ctx, inputs, output):CODE
LOWapex/normalization/fused_layer_norm.py241 def fused_rms_norm_affine_fwd(CODE
LOWapex/normalization/fused_layer_norm.py260 def fused_rms_norm_affine_fwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py289 def fused_rms_norm_affine_bwd(CODE
LOWapex/normalization/fused_layer_norm.py310 def fused_rms_norm_affine_bwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py323 def _fused_rms_norm_affine_backward(ctx, grad_output, grad_invvar):CODE
LOWapex/normalization/fused_layer_norm.py337 def _fused_rms_norm_affine_setup_context(ctx, inputs, output):CODE
LOWapex/normalization/fused_layer_norm.py449 def fused_layer_norm_fwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py490 def fused_layer_norm_bwd_fake(CODE
LOWapex/normalization/fused_layer_norm.py502 def _fused_layer_norm_backward(ctx, grad_output, grad_mean, grad_invvar):CODE
LOWapex/normalization/fused_layer_norm.py515 def _fused_layer_norm_setup_context(ctx, inputs, output):CODE
LOWapex/normalization/fused_layer_norm.py653 def _fused_rms_norm_setup_context(ctx, inputs, output):CODE
LOWapex/normalization/fused_layer_norm.py690def mixed_dtype_fused_layer_norm_affine(CODE
LOWapex/normalization/fused_layer_norm.py716def mixed_dtype_fused_rms_norm_affine(CODE
LOWapex/contrib/sparsity/asp.py271 def init_optimizer_for_pruning(cls, optimizer):CODE
LOWapex/contrib/sparsity/asp.py444 def set_permutation_saving_params(CODE
LOW⚡apex/contrib/sparsity/permutation_lib.py1942 def trace_and_print_raw_fx_graph(cls, model, print_tabular=False, generate_python_code=False):CODE
LOWapex/contrib/sparsity/permutation_lib.py195 def set_permutation_saving_params(CODE
LOWapex/contrib/sparsity/permutation_lib.py213 def set_permutation_params_from_asp(cls, model, sparse_parameters, all_parameters, verbosity):CODE
LOWapex/contrib/sparsity/permutation_lib.py536 def check_graph_for_unpermuted_nodes(cls, fx_graph):CODE
LOWapex/contrib/sparsity/permutation_lib.py594 def find_sparse_parameters_for_node(cls, node_name):CODE
LOWapex/contrib/sparsity/permutation_lib.py631 def find_permutation_for_matrix_group(cls, matrix_group):CODE
LOWapex/contrib/sparsity/permutation_lib.py770 def find_sibling_group_permutation(cls, fx_graph, sibling_group_id):CODE
LOWapex/contrib/sparsity/permutation_lib.py1114 def init_grouped_conv_permutation_flags(fx_graph, node_name, node_groups, verbosity):CODE
LOWapex/contrib/sparsity/permutation_lib.py1453 def enforce_dimension_agreement(cls, fx_graph):CODE
LOWapex/contrib/sparsity/permutation_lib.py1505 def make_sibling_coparent_groups(cls, fx_graph):CODE
LOWapex/contrib/sparsity/permutation_lib.py1558 def propagate_permutation_flags(cls, fx_graph):CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py36def generate_unique_combinations(CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py76def generate_all_unique_combinations(C, M, must_use_all_groups=False):CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py102def predict_unique_combinations(C, M):CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py166def apply_stripe_group_permutation(sgp, stripes, group_width, permutation):CODE
LOW…ib/sparsity/permutation_search_kernels/channel_swap.py30def stripes_and_swap_idx_to_columns(stripe0, stripe1, idx):CODE
LOW…ib/sparsity/permutation_search_kernels/channel_swap.py41def columns_to_stripes_and_swap_idx(col0, col1):CODE
LOW…tion_search_kernels/call_permutation_search_kernels.py7def accelerated_search_for_good_permutation(matrix_group, options=None, verbosity=0):CODE
LOW…ty/permutation_search_kernels/permutation_utilities.py128def magnitude_after_pruning_rows(matrix, rate=0.5):CODE
LOW…ty/permutation_search_kernels/permutation_utilities.py145def try_permutations_on_matrix(matrix, permutations):CODE
LOWapex/contrib/test/xentropy/test_label_smoothing.py63 def _test_label_smoothing_function(self, dtype):CODE
LOWapex/contrib/test/xentropy/test_label_smoothing.py102 def test_label_smoothing_perf(self):CODE
LOWapex/contrib/test/layer_norm/test_fast_layer_norm.py269 def test_compat_with_autocast(self):CODE
LOW…contrib/test/optimizers/test_distributed_fused_lamb.py73 def test_distributed_fused_lamb(self, no_copy, opt_kwargs):CODE
LOW⚡apex/contrib/test/optimizers/test_dist_adam.py270 def test_matches_pytorch_no_overlap(self):CODE
LOW⚡apex/contrib/test/optimizers/test_dist_adam.py276 def test_matches_pytorch_sync_every_step(self):CODE
LOW⚡apex/contrib/test/optimizers/test_dist_adam.py279 def test_matches_pytorch_contiguous_buffers(self):CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py341 def test_matches_pytorch_multi_dtypes(self):CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py374 def test_matches_pytorch_scaled_state(self):CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py386 def test_matches_pytorch_nccl_ub(self):CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py785 def test_checkpoint_scaled_state(self):CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py806 def test_bucket_low_utilization_warning(self):CODE
LOWapex/contrib/test/bottleneck/test_bottleneck_module.py118def apply_to_different_bottleneck(gt, bottleneck):CODE
LOWapex/contrib/test/bottleneck/test_bottleneck_module.py150def spatial_parallel_bottleneck(C, dtype, explicit_nhwc, gt_bottleneck, spatial_parallel_args):CODE
87 more matches not shown…
Unused Imports96 hits · 93 pts
SeverityFileLineSnippetContext
LOWapex/__init__.py1CODE
LOWapex/__init__.py14CODE
LOWapex/__init__.py14CODE
LOWapex/_autocast_utils.py2CODE
LOWapex/distributed_testing/__init__.py3CODE
LOWapex/distributed_testing/__init__.py3CODE
LOWapex/distributed_testing/__init__.py3CODE
LOWapex/distributed_testing/_ucc_util.py6CODE
LOWapex/normalization/fused_layer_norm.py3CODE
LOWapex/normalization/fused_layer_norm.py3CODE
LOWapex/normalization/__init__.py1CODE
LOWapex/normalization/__init__.py1CODE
LOWapex/normalization/__init__.py1CODE
LOWapex/normalization/__init__.py1CODE
LOWapex/fused_dense/__init__.py1CODE
LOWapex/multi_tensor_apply/multi_tensor_apply.py7CODE
LOWapex/contrib/index_mul_2d/__init__.py1CODE
LOWapex/contrib/sparsity/__init__.py1CODE
LOWapex/contrib/sparsity/__init__.py2CODE
LOWapex/contrib/sparsity/permutation_lib.py1978CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py1CODE
LOW…ib/sparsity/permutation_search_kernels/channel_swap.py1CODE
LOW…tion_search_kernels/call_permutation_search_kernels.py4CODE
LOW…ontrib/sparsity/permutation_search_kernels/__init__.py1CODE
LOW…ontrib/sparsity/permutation_search_kernels/__init__.py2CODE
LOW…contrib/sparsity/permutation_tests/permutation_test.py13CODE
LOWapex/contrib/groupbn/__init__.py5CODE
LOWapex/contrib/cudnn_gbn/__init__.py1CODE
LOW…contrib/test/cudnn_gbn/test_cudnn_gbn_with_two_gpus.py2CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py6CODE
LOWapex/contrib/test/openfold_triton/test_openfold_mha.py4CODE
LOWapex/contrib/xentropy/__init__.py1CODE
LOWapex/contrib/torchsched/backend.py3CODE
LOWapex/contrib/torchsched/__init__.py3CODE
LOWapex/contrib/torchsched/inductor/wrapper.py12CODE
LOWapex/contrib/torchsched/inductor/event.py12CODE
LOWapex/contrib/torchsched/inductor/graph.py3CODE
LOWapex/contrib/torchsched/inductor/__init__.py3CODE
LOWapex/contrib/torchsched/inductor/scheduler.py3CODE
LOWapex/contrib/torchsched/inductor/scheduler.py14CODE
LOWapex/contrib/torchsched/inductor/scheduler.py14CODE
LOWapex/contrib/torchsched/inductor/scheduler.py32CODE
LOWapex/contrib/torchsched/inductor/_utils.py1CODE
LOWapex/contrib/torchsched/passes/__init__.py3CODE
LOWapex/contrib/torchsched/passes/__init__.py5CODE
LOWapex/contrib/torchsched/passes/pre_grad_passes.py3CODE
LOWapex/contrib/torchsched/ops/layer_norm.py8CODE
LOWapex/contrib/layer_norm/__init__.py1CODE
LOWapex/contrib/nccl_allocator/__init__.py1CODE
LOWapex/contrib/optimizers/__init__.py1CODE
LOWapex/contrib/optimizers/__init__.py2CODE
LOWapex/contrib/optimizers/__init__.py3CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py11CODE
LOWapex/contrib/bottleneck/__init__.py1CODE
LOWapex/contrib/bottleneck/__init__.py1CODE
36 more matches not shown…
Deep Nesting76 hits · 60 pts
SeverityFileLineSnippetContext
LOWapex/contrib/sparsity/asp.py41CODE
LOWapex/contrib/sparsity/asp.py316CODE
LOWapex/contrib/sparsity/asp.py390CODE
LOWapex/contrib/sparsity/permutation_lib.py338CODE
LOWapex/contrib/sparsity/permutation_lib.py427CODE
LOWapex/contrib/sparsity/permutation_lib.py467CODE
LOWapex/contrib/sparsity/permutation_lib.py536CODE
LOWapex/contrib/sparsity/permutation_lib.py594CODE
LOWapex/contrib/sparsity/permutation_lib.py728CODE
LOWapex/contrib/sparsity/permutation_lib.py876CODE
LOWapex/contrib/sparsity/permutation_lib.py953CODE
LOWapex/contrib/sparsity/permutation_lib.py988CODE
LOWapex/contrib/sparsity/permutation_lib.py1145CODE
LOWapex/contrib/sparsity/permutation_lib.py1286CODE
LOWapex/contrib/sparsity/permutation_lib.py1324CODE
LOWapex/contrib/sparsity/permutation_lib.py1354CODE
LOWapex/contrib/sparsity/permutation_lib.py1453CODE
LOWapex/contrib/sparsity/permutation_lib.py1505CODE
LOWapex/contrib/sparsity/permutation_lib.py1558CODE
LOWapex/contrib/sparsity/permutation_lib.py1734CODE
LOWapex/contrib/sparsity/sparse_masklib.py86CODE
LOWapex/contrib/sparsity/sparse_masklib.py176CODE
LOW…arsity/permutation_search_kernels/exhaustive_search.py296CODE
LOW…ib/sparsity/permutation_search_kernels/channel_swap.py94CODE
LOW…ib/sparsity/permutation_search_kernels/channel_swap.py141CODE
LOW…tion_search_kernels/call_permutation_search_kernels.py7CODE
LOW…ty/permutation_search_kernels/permutation_utilities.py287CODE
LOW…ty/permutation_search_kernels/permutation_utilities.py416CODE
LOW…ty/permutation_search_kernels/permutation_utilities.py559CODE
LOW…/contrib/sparsity/test/test_permutation_application.py784CODE
LOW…/contrib/sparsity/test/test_permutation_application.py25CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py122CODE
LOWapex/contrib/test/bottleneck/test_bottleneck_module.py34CODE
LOWapex/contrib/torchsched/inductor/scheduler.py122CODE
LOWapex/contrib/torchsched/inductor/scheduler.py414CODE
LOWapex/contrib/nccl_allocator/nccl_allocator.py49CODE
LOWapex/contrib/optimizers/fused_adam.py80CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py539CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py937CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py1550CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py1599CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py1826CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py1876CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2031CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2123CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2149CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2367CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2504CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py2906CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py3058CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py3396CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py3160CODE
LOWapex/contrib/optimizers/fp16_optimizer.py83CODE
LOWapex/contrib/optimizers/fused_lamb.py112CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py100CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py388CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py587CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py940CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py1067CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py1203CODE
16 more matches not shown…
Cross-File Repetition10 hits · 50 pts
SeverityFileLineSnippetContext
HIGHapex/contrib/optimizers/fused_lamb.py0implements lamb algorithm. currently gpu-only. requires apex to be installed via ``pip install -v --no-cache-dir --globaSTRING
HIGHapex/contrib/optimizers/distributed_fused_lamb.py0implements lamb algorithm. currently gpu-only. requires apex to be installed via ``pip install -v --no-cache-dir --globaSTRING
HIGHapex/optimizers/fused_lamb.py0implements lamb algorithm. currently gpu-only. requires apex to be installed via ``pip install -v --no-cache-dir --globaSTRING
HIGHapex/contrib/optimizers/fused_lamb.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHapex/optimizers/fused_novograd.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHapex/optimizers/fused_adagrad.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHapex/optimizers/fused_lamb.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHapex/optimizers/fused_sgd.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHtests/L0/run_optimizers/test_lamb.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
HIGHtests/L0/run_optimizers/test_fused_novograd.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and rSTRING
Self-Referential Comments13 hits · 23 pts
SeverityFileLineSnippetContext
MEDIUMapex/contrib/sparsity/asp.py450 """This function is used to set the permutation saving related parameters in ASP class and inside of the PermutaSTRING
MEDIUM⚡apex/contrib/sparsity/permutation_lib.py1943 """This function is used to find and print the intermediate representation (IR) - Graph representation with TorcSTRING
MEDIUMapex/contrib/sparsity/permutation_lib.py201 """This function is used to set the permutation saving related parameters."""STRING
MEDIUMapex/contrib/sparsity/permutation_lib.py214 """This function is used to set the permutation needed parameters from ASP class."""STRING
MEDIUMapex/contrib/sparsity/permutation_lib.py339 """This function is used to permutation for a node in C dim. (Only need to handle the weight of the node)"""STRING
MEDIUMapex/contrib/sparsity/permutation_lib.py468 """This function is used to permutation for a node in K dim. (Need to handle the weight/bias/running_mean/runninSTRING
MEDIUMapex/contrib/sparsity/permutation_lib.py2005 """This function is used to save the graph into JSON file for inspection."""STRING
MEDIUM…tion_search_kernels/call_permutation_search_kernels.py8 """This function is used to call the permutation search CUDA kernels.STRING
MEDIUMapex/optimizers/fused_novograd.py100 # Creating the overflow buffer on the same device as the params tensors.COMMENT
MEDIUMapex/optimizers/fused_novograd.py184 # Creating the following parameters on the same device as the params tensors.COMMENT
MEDIUMapex/optimizers/fused_novograd.py210 # Creating the following parameters on the same device as the params tensors.COMMENT
MEDIUMapex/optimizers/fused_mixed_precision_lamb.py72 # This method is overridden from the parent class because there is not a way to overrideCOMMENT
MEDIUMdocs/source/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
Over-Commented Block22 hits · 22 pts
SeverityFileLineSnippetContext
LOWcsrc/type_shim.h1#include <ATen/ATen.h>COMMENT
LOWcsrc/static_switch.h1// FromCOMMENT
LOWcsrc/syncbn.cpp1#include <ATen/ATen.h>COMMENT
LOWapex/contrib/csrc/groupbn/interface.cpp1#include <ATen/ATen.h>COMMENT
LOWapex/contrib/csrc/groupbn/nhwc_batch_norm_kernel.h861 // Clamp thread_c so that we load from valid locations even if we don't use the valueCOMMENT
LOWapex/contrib/csrc/cudnn_gbn/norm_sample.h21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERCOMMENT
LOWapex/contrib/csrc/bottleneck/bottleneck.cpp1#include <ATen/ATen.h>COMMENT
LOWapex/contrib/csrc/conv_bias_relu/conv_bias_relu.cpp1#include <ATen/ATen.h>COMMENT
LOWapex/contrib/csrc/group_norm/traits.h1/*COMMENT
LOW…contrib/csrc/group_norm/group_norm_nhwc_fwd_one_pass.h1/*COMMENT
LOW…contrib/csrc/group_norm/group_norm_nhwc_bwd_one_pass.h1/*COMMENT
LOW…arsity/permutation_search_kernels/exhaustive_search.py1from .permutation_utilities import *COMMENT
LOWapex/contrib/test/bottleneck/test_bottleneck_module.py261 # class HaloExchangerAllGather(HaloExchanger):COMMENT
LOW…rib/test/peer_memory/test_peer_halo_exchange_module.py141 # "SUCCESS : N,C,H,W = 1,%d,%d,%d, half_halo=%d, %s, %s, %s"COMMENT
LOW…ex/contrib/test/openfold_triton/test_fused_adam_swa.py1# Copyright 2023 NVIDIA CORPORATIONCOMMENT
LOWapex/contrib/torchsched/backend.py281COMMENT
LOWapex/contrib/torchsched/backend.py301 #COMMENT
LOWapex/contrib/optimizers/fp16_optimizer.py241 # Pytorch Optimizer.load_state_dict casts saved buffers (e.g. momentum) to the type and deviceCOMMENT
LOWdocs/source/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/source/conf.py61master_doc = "index"COMMENT
LOWdocs/source/conf.py141latex_elements = {COMMENT
LOWexamples/imagenet/main_amp.py261 self.next_target = NoneCOMMENT
AI Structural Patterns19 hits · 18 pts
SeverityFileLineSnippetContext
LOWapex/fused_dense/fused_dense.py14CODE
LOWapex/fused_dense/fused_dense.py30CODE
LOWapex/contrib/sparsity/asp.py41CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py33CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py122CODE
LOWapex/contrib/test/optimizers/test_dist_adam.py492CODE
LOWapex/contrib/test/group_norm/test_group_norm.py118CODE
LOWapex/contrib/optimizers/fused_adam.py40CODE
LOWapex/contrib/optimizers/distributed_fused_adam.py539CODE
LOWapex/contrib/optimizers/fused_lamb.py65CODE
LOWapex/contrib/optimizers/distributed_fused_lamb.py100CODE
LOWapex/contrib/bottleneck/bottleneck.py298CODE
LOWapex/contrib/bottleneck/bottleneck.py1012CODE
LOWapex/contrib/openfold_triton/fused_adam_swa.py211CODE
LOWapex/optimizers/fused_novograd.py68CODE
LOWapex/optimizers/fused_adam.py69CODE
LOWapex/optimizers/fused_mixed_precision_lamb.py12CODE
LOWapex/optimizers/fused_lamb.py64CODE
LOWapex/optimizers/fused_sgd.py77CODE
Modern Structural Boilerplate16 hits · 16 pts
SeverityFileLineSnippetContext
LOWapex/__init__.py16__all__ = ["normalization", "optimizers"]CODE
LOWapex/_autocast_utils.py6__all__ = ["_cast_if_autocast_enabled"]CODE
LOWapex/distributed_testing/__init__.py9__all__ = [CODE
LOWapex/distributed_testing/distributed_test_base.py101 def _setup_pre_spawn(self) -> None:CODE
LOWapex/contrib/xentropy/__init__.py3__all__ = [CODE
LOWapex/contrib/torchsched/backend.py26__all__ = ["get_backend"]CODE
LOWapex/contrib/torchsched/__init__.py20__all__ = ["get_backend", "set_default_backend"]CODE
LOWapex/contrib/torchsched/__init__.py45def set_default_backend(backend: str) -> None:CODE
LOWapex/contrib/torchsched/inductor/__init__.py5__all__ = ["patch_graph_lowering"]CODE
LOWapex/contrib/torchsched/inductor/_utils.py12__all__ = [CODE
LOWapex/contrib/torchsched/passes/__init__.py7__all__ = ["pre_grad_custom_pass"]CODE
LOWapex/contrib/torchsched/passes/pre_grad_passes.py17__all__ = ["pre_grad_custom_pass"]CODE
LOWapex/contrib/torchsched/ops/layer_norm.py15__all__ = ["get_cudnn_manager"]CODE
LOWapex/contrib/torchsched/ops/layer_norm.py49 def set_stream(self, stream: torch.cuda.Stream) -> None:CODE
LOWapex/contrib/nccl_allocator/nccl_allocator.py7__all__ = ["create_nccl_mem_pool", "init", "nccl_mem"]CODE
LOWapex/contrib/group_norm/group_norm.py18__all__ = ["GroupNorm"]CODE
Empty Error Handlers3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHapex/contrib/nccl_allocator/nccl_allocator.py79except RuntimeError:CODE
HIGHapex/contrib/nccl_allocator/nccl_allocator.py87except RuntimeError:CODE
HIGHexamples/dcgan/main_amp.py46except OSError:CODE
Redundant / Tautological Comments8 hits · 12 pts
SeverityFileLineSnippetContext
LOWsetup.py852 # Check if APEX_PARALLEL_BUILD environment variable is setCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py200 # Check if buffers support fused kernelCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py789 # Check if collectives have no_copy optionCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py1539 # Check if buckets are underutilizedCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py1725 # Check if fragment needs to be updatedCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py2169 # Check if provided parameters are subset of all parametersCOMMENT
LOWapex/contrib/optimizers/distributed_fused_adam.py2795 # Check if param shard is already in expected dtypeCOMMENT
LOWapex/contrib/optimizers/distributed_fused_lamb.py199 # Check if collectives have no_copy optionCOMMENT
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHapex/contrib/torchsched/backend.py262Get the graph scheduler backend for model compilation. This function returns the appropriate backend for model compSTRING
HIGHapex/contrib/torchsched/inductor/scheduler.py234Register one CUDA event indicating node execution complete. For ordinary Inductor IR nodes, the completion evenSTRING
Verbosity Indicators2 hits · 4 pts
SeverityFileLineSnippetContext
LOW⚡apex/contrib/sparsity/asp.py322 # Step 1: use the Torch.FX library to build the graphCOMMENT
LOW⚡apex/contrib/sparsity/asp.py323 # Step 2: permutation search with the customized kernelCOMMENT
Structural Annotation Overuse2 hits · 4 pts
SeverityFileLineSnippetContext
LOW⚡apex/contrib/sparsity/asp.py322 # Step 1: use the Torch.FX library to build the graphCOMMENT
LOW⚡apex/contrib/sparsity/asp.py323 # Step 2: permutation search with the customized kernelCOMMENT
AI Slop Vocabulary3 hits · 4 pts
SeverityFileLineSnippetContext
LOWapex/contrib/sparsity/permutation_lib.py1636 # if it's a real node, just add itCOMMENT
LOWapex/contrib/sparsity/permutation_lib.py1694 # if it's a real node, just add itCOMMENT
MEDIUMapex/contrib/sparsity/permutation_lib.py254 """Permute a model's weights in order to maintain more magnitude after enforcing the sparsity constraint."""STRING
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOW⚡apex/contrib/sparsity/permutation_lib.py1952 except Exception as ex:CODE
LOWapex/contrib/torchsched/inductor/scheduler.py444 except Exception:CODE
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/L1/common/main_amp.py456 # print_freq iterations, make sure to move this prefetching below the accuracy calculation.COMMENT
Fake / Example Data1 hit · 0 pts
SeverityFileLineSnippetContext
LOWapex/contrib/sparsity/permutation_lib.py1823 if node.op == "placeholder":CODE