Skip to content

Commit

Permalink
Add device mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
cdoko authored Dec 31, 2024
1 parent efbd6f4 commit 8a0177a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mistralrs-core/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod vision;

pub use super::diffusion_models::DiffusionGenerationParams;
use crate::amoe::{AnyMoeConfig, AnyMoeExpertType, AnyMoeTrainingInputs, AnyMoeTrainingResult};
use crate::device_map::DeviceMapper;
use crate::paged_attention::{CacheConfig, CacheEngine, ModelConfigLike};
use crate::prefix_cacher_v2::PrefixCacheManagerV2;
pub use amoe::{AnyMoeLoader, AnyMoePipeline};
Expand Down Expand Up @@ -148,6 +149,7 @@ pub trait MetadataMixin {
fn name(&self) -> String;
fn reset_non_granular_state(&self);
fn get_metadata(&self) -> Arc<GeneralMetadata>;
fn device_mapper(&self) -> Option<&dyn DeviceMapper>;
}

/// Implemented by the base model of an AnyMoe.
Expand Down Expand Up @@ -326,6 +328,7 @@ pub trait Pipeline:
self.get_input_processor_config(),
None,
self.get_metadata().prompt_batchsize,
self.device_mapper(),
);

let mut logits = vec![None; input_seqs.len()];
Expand Down Expand Up @@ -538,6 +541,7 @@ pub trait Pipeline:
self.get_input_processor_config(),
Some(metadata),
self.get_metadata().prompt_batchsize,
self.device_mapper(),
);

let mut logits = vec![None; input_seqs.len()];
Expand Down

0 comments on commit 8a0177a

Please sign in to comment.