Scan your whole stack
From OX Research Newsroom
Latest version: vgit:c101ed5f3053fda499db79e9ef0502bee40dbfa5
convert-hf-to-te was last scanned on 26 Nov 2026 at commit c101ed5f. Risk score 1 of 100 (low). No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| c101ed5f | 2 rules fired |
Findings for commit c101ed5f. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The skill's text or bundled scripts contain encoded content, such as a long base64 or hex string, a dense run of hex escapes, or invisible Unicode tag characters that can carry hidden instructions. Skills rarely need these. On its own this is not evidence of malicious behavior.
LOWThe score describes c101ed5f; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Use the project's requested entry point or add a model-family module such as te_llama.py.
Replace compatible building blocks of the Hugging Face (HF) model with Transformer Engine (TE)
modules and load the original checkpoint into them. The building block is the whole transformer
layer, as for Llama and Gemma, or else the attention
(MHA, linear attention) and MLP or MoE blocks inside it. A partial conversion can also replace
a single operation inside an HF block. For a review or plan, stop after the requested feasibility,
boundary or weight-mapping decision in Steps 1–3. For a local implementation, Step 4 ends at the
first BF16 forward comparison. Use Step 5 for requested training checks, integration or performance
measurements at the scope the user specified.
In this skill te means transformer_engine.pytorch.
In a plan or implementation handoff, lead with the chosen replacement boundary and weight map.
Not for JAX or inference serving (vLLM, TensorRT-LLM). For Megatron-LM or another PyTorch framework, the TE implementation can serve as a reference for which TE modules to use and how the weights map.
Identify the training path, representative inputs and target precision from the request and project.
Read the model's config.json, checkpoint keys and decoder forward at the requested revision
or installed version. For each distinct layer type, record its modules, which tensors they consume
or share, and their checkpoint keys. Use this inventory to identify candidate TE modules.
Consult examples for the relevant boundary and verify API choices against the target TE release.
For source-only work, use those sources to resolve API and layout questions before setting up a
runtime.
| HF component | Candidate TE module |
|---|---|
| The whole transformer block | te.TransformerLayer |
| Self-attention with QKV and output projections | te.MultiheadAttention. Set input_layernorm=True only when it replaces HF's input norm, so the norm runs once. |
| Scaled dot-product attention on projected Q/K/V | te.DotProductAttention |
| Input norm followed by one linear projection, which can pack compatible projections of the same normalized input | te.LayerNormLinear |
| A norm and a dense MLP | te.LayerNormMLP |
| Grouped linear projections across MoE experts | te.ops.GroupedLinear. The surrounding MoE block supplies activation and routing. |
| Dispatch and combine across expert-parallel ranks | te.ops.MoeDispatch and te.ops.MoeCombine in the experimental operation fuser. Check compatibility with the router outputs and backend. |
| A single projection or norm | te.Linear, te.RMSNorm, te.LayerNorm |
The table is not exhaustive. Newer architectures may need other TE modules, such as the
experimental Gated DeltaNet core (te.GatedDeltaNetAttention). Check that the installed TE
exports the candidate and its backend supports the target inputs and workload. Keep unsupported
components in HF.
Start with the largest region that preserves HF's computation and the interface its caller uses. The level describes which part of the HF model you replace.
Level 1: the whole transformer block. Try one te.TransformerLayer for the HF decoder block.
Match the attention and MLP widths, query and KV head counts, normalization and residual order,
activation, mask, and rotary positions for the requested inputs. A causal HF decoder with only
self-attention uses TE's self-attention topology with a causal mask. In TE 2.18, layer_type="decoder"
adds cross-attention. When the block matches, substitute it at the HF decoder entry point and preserve
the caller's arguments, layout and return value. Map the norm, attention and MLP weights and compare
the whole block's BF16 output to HF in Step 4.
Llama wrapper ·
Gemma constructor ·
TE layer topology
Level 2: attention and MLP separately. If the whole layer does not fit, consider each sublayer independently. Experts and linear attention are two examples from a non-exhaustive list.
te.MultiheadAttention when it implements the target attention block.te.LayerNormMLP for a dense MLP. For mixture-of-experts (MoE), compose a model-specific
block around the compatible operations. For example,
te_mixtral.py
defines its own TEMixtralSparseMoeBlock to route tokens, run the expert FFN and combine outputs.Level 3: an operation inside an HF sublayer. For example, replace a projection inside HF attention or the expert GEMMs inside an HF MoE block. Choose this boundary when you can preserve its inputs, outputs and shared state and have a workload benefit to test. If TE cannot reproduce the attention behavior, keep HF's attention computation, masking, positions and cache together. An independent MLP can still benefit. Keep HF wherever correctness or measured performance favors it.
Choose fusions before mapping weights. Preserve operation order and all consumers of a shared tensor. For example, TE can combine:
te.LayerNormLinear, or te.MultiheadAttention with
input_layernorm=True;te.LayerNormMLP.Look up other fusions in the PyTorch API and operation fuser guide. Check the installed release for support at the target shapes, dtype and hardware.
Use the Step 1 inventory and Step 2 boundaries to map each required HF key or slice to a TE parameter and slice. Record axis, order and intended cast where the layout changes. Preserve tied weights. For expert-parallel MoE, map each global expert ID to its owning rank and local expert parameter. When loading quantized weights into BF16, use the checkpoint's quantization metadata to recover the reference values.
Plan how the loader will track copies across all shards. Require it to fail on any missing required source or destination slice. For packed weights, reconstruct the named HF tensors after loading and compare after the intended cast to catch equal-shaped swaps. Three examples illustrate why the layout matters:
Choose checks that exercise the HF module being compared. These model-specific examples are non-exhaustive.
1 + weight (Gemma, Qwen3.5) needs zero_centered_gamma=True.kv_channels.
config.head_dim is not always that; in GLM-5 it is only the RoPE part of each head.
For multi-head latent attention, check HF's effective softmax scale and which slice of
Q and K receives rotary embeddings before substituting the attention core.post_init() overwrites TE weights; load the checkpoint before training.Once the replacement outputs match, compare integrated HF and TE outputs on the same BF16 inputs and with the same stochastic controls. For training, match labels and loss reduction, then compare loss and a gradient or optimizer update on a replaced parameter in each changed path. Use the same parameter layout and exercise a routed expert for MoE. If the full model does not fit, start with a deterministic check for each changed layer type and report the layers it covers. When you supply a comparison, put its source entry point, exact command, what it checks and execution status together in the handoff. Report weight mapping coverage and any blockers. When execution is outside scope or unavailable, mark numerical results as unverified. Use FP32 to diagnose discrepancies. If the workload calls for lower-precision execution, repeat the relevant checks with that recipe and its own tolerances.
For requested FP8 training, verify the BF16 port first and choose a TE recipe supported by the
installed release, GPU and operation shapes. If the trainer manages TE precision, configure its
TE backend. In a manual loop, wrap the model forward in with te.autocast(enabled=True, recipe=fp8_recipe):
and call loss.backward() after leaving the context. Keep the baseline parameter and loss dtypes.
Compare loss and a gradient or update for a replaced weight against the matched BF16 run using
recipe-specific tolerances. Report the FP8 check as pending if the target is unavailable.
Before recommending a speedup, warm up and synchronize end-to-end runs of optimized HF and TE. Compare them first in BF16 with matched effective tokens, batching and GPU topology. Measure a requested precision change separately. Report the HF/TE versions, workload, measured result, regions kept or replaced and why, and mapping and parity evidence. Identify unmeasured results. For training-step timing, see the Llama warmup and timed loop and the Mixtral per-step CUDA events.
These illustrative troubleshooting notes show how checkpoint, expert and attention issues can surface when instructions in this skill are followed over successive iterations for one example model - Qwen3.5.
Weights are missing or left over (Qwen3.5). Take the names from the checkpoint files, not
from model.state_dict(): a checkpoint may stack all experts of a layer in one tensor, and the
layer prefix may be deeper (model.language_model.layers.N.). Skip what HF skips
(_keys_to_ignore_on_load_unexpected). A model made of sub-models needs every sub-config's
dtype set, or HF builds parts of it in float32.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.