.. _error-code-enki006:
.. _error-code-evrf067:

.. meta::
   :description: AWS Neuron SDK Graph Compiler error code documentation for errors ENKI006 and EVRF067.

NCC_ENKI006 / NCC_EVRF067
=========================

**Error messages**:

- ``NCC_EVRF067``: Kernel path '<path>' referenced by AwsNeuronCustomNativeKernel instruction is malformed: a path that starts with {nki_cache} must continue with '/'.
- ``NCC_ENKI006``: Malformed NKI kernel path <path>: expected {nki_cache}/<path>.

These errors occur when an NKI (Neuron Kernel Interface) kernel reference in the HLO/StableHLO graph starts with the ``{nki_cache}`` placeholder but is not followed by ``/``, for example ``{nki_cache}`` or ``{nki_cache}nki_0.8.0/...``. ``NCC_EVRF067`` is reported during graph verification, and ``NCC_ENKI006`` during kernel lowering.

How NKI kernel paths are stored
-------------------------------

When a model uses NKI kernels, NKI compiles each kernel into an artifact in its compile cache and writes a reference to that artifact into the graph. A kernel in the cache is referenced as ``{nki_cache}/<path relative to the cache directory>``, so the graph is the same for every user. ``neuronx-cc`` replaces ``{nki_cache}`` with the cache directory of the user running the compiler: the value of ``NKI_COMPILE_CACHE_URL``, or the per-user default ``/var/tmp/nki-intermediate-cache-uid<uid>`` when it is unset.

NKI always writes the placeholder followed by ``/``, so a path without it was not produced by NKI or was modified afterwards.

Common causes
-------------

- The graph was generated or edited by a tool other than NKI that wrote the kernel path incorrectly.
- The graph was modified after tracing, for example by rewriting kernel paths.

Resolution
----------

Retrace the model with NKI so the graph carries a well-formed kernel path. If a tool rewrites kernel paths in the graph, make sure it keeps the ``{nki_cache}/`` prefix intact.
