LLM Model Local Data#
-
class ModelLocalDataFactory : public trt_edgellm::safety::SafetyModelLocalDataFactory#
Batched FP16 embeddings and contiguous FP16 KV, shared by the initial InternVL LLM stages. The factory owns query metadata; borrowed tensor views remain owned by the Runner adapter.
Public Functions
- ModelLocalDataFactory(
- ModelResourceSpec spec,
- StageResourceSpec prefill,
- StageResourceSpec decode
- virtual SafetyStatus declareResources(
- ResourceDeclaration &output
- virtual SafetyStatus create(
- PreparedResources const &resources,
- std::unique_ptr<SafetyModelLocalData> &output
Construct metadata over prepared storage; transfer object ownership to SafetyRuntime.
-
struct ModelResourceSpec#
Artifact reader supplies these immutable LLM dimensions before resource declaration.
-
struct StageResourceSpec#
Engine-query metadata for one selected stage/profile; no allocated resources.
Public Members
-
LMStageId stage = {}#
-
int32_t profileId = {-1}#
-
std::vector<RuntimeTensorDesc> bindings = {}#
-
LMStageId stage = {}#
-
struct StageResources#
Public Members
-
LMStageId stage = {}#
-
int32_t profileId = {-1}#
-
std::vector<RuntimeTensorView const*> bindings = {}#
-
cudaStream_t stream = {nullptr}#
-
LMStageId stage = {}#
-
struct ModelLocalData : public trt_edgellm::safety::SafetyModelLocalData#
Runtime-owned metadata over manager-owned storage. Processing initializes embedding/RoPE payloads and synchronizes Initialization GPU work before SafetyRuntime publishes readiness.
Public Members
-
ModelResourceSpec spec = {}#
-
StageResources prefill = {}#
-
StageResources decode = {}#
-
std::array<RuntimeMemoryView, static_cast<std::size_t>(ModelMemory::kCOUNT)> storage = {}#
-
int32_t maxPrefillTokens = {0}#
-
int32_t maxContextLength = {0}#
-
ModelResourceSpec spec = {}#