| 291 | } // namespace |
| 292 | |
| 293 | AceStepDitWeightsRuntime::AceStepDitWeightsRuntime( |
| 294 | std::shared_ptr<const AceStepAssets> assets, |
| 295 | core::ExecutionContext & execution, |
| 296 | assets::TensorStorageType storage_type, |
| 297 | size_t weight_context_bytes) |
| 298 | : assets_(std::move(assets)) { |
| 299 | if (!assets_) { |
| 300 | throw std::runtime_error("ACE-Step DiT weights runtime requires assets"); |
| 301 | } |
| 302 | if (execution.backend() == nullptr) { |
| 303 | throw std::runtime_error("ACE-Step DiT weights runtime backend is not initialized"); |
| 304 | } |
| 305 | store_ = std::make_shared<core::BackendWeightStore>( |
| 306 | execution.backend(), |
| 307 | execution.backend_type(), |
| 308 | "ace_step.dit.weights", |
| 309 | weight_context_bytes); |
| 310 | detokenizer_weights_ = load_detokenizer_weights(store_, *assets_, storage_type); |
| 311 | condition_encoder_weights_ = load_condition_encoder_weights(store_, *assets_, storage_type); |
| 312 | diffusion_weights_ = load_diffusion_weights(store_, *assets_, storage_type); |
| 313 | store_->upload(); |
| 314 | assets_->dit_weights->release_storage(); |
| 315 | } |
| 316 | |
| 317 | const std::shared_ptr<const AceStepAssets> & AceStepDitWeightsRuntime::assets() const noexcept { |
| 318 | return assets_; |
nothing calls this directly
no test coverage detected