Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --dtype in mistralrs bench #911

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions mistralrs-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use candle_core::Device;
use clap::Parser;
use cli_table::{format::Justify, print_stdout, Cell, CellStruct, Style, Table};
use mistralrs_core::{
initialize_logging, paged_attn_supported, parse_isq_value, Constraint, DefaultSchedulerMethod,
DeviceLayerMapMetadata, DeviceMapMetadata, DrySamplingParams, IsqType, Loader, LoaderBuilder,
MemoryGpuConfig, MistralRs, MistralRsBuilder, ModelDType, ModelSelected, NormalRequest,
PagedAttentionConfig, Request, RequestMessage, Response, SamplingParams, SchedulerConfig,
TokenSource, Usage,
get_model_dtype, initialize_logging, paged_attn_supported, parse_isq_value, Constraint,
DefaultSchedulerMethod, DeviceLayerMapMetadata, DeviceMapMetadata, DrySamplingParams, IsqType,
Loader, LoaderBuilder, MemoryGpuConfig, MistralRs, MistralRsBuilder, ModelSelected,
NormalRequest, PagedAttentionConfig, Request, RequestMessage, Response, SamplingParams,
SchedulerConfig, TokenSource, Usage,
};
use std::sync::Arc;
use std::{fmt::Display, num::NonZeroUsize};
Expand Down Expand Up @@ -348,6 +348,8 @@ fn main() -> anyhow::Result<()> {
None => None,
};

let dtype = get_model_dtype(&args.model)?;

let loader: Box<dyn Loader> = LoaderBuilder::new(args.model)
.with_use_flash_attn(use_flash_attn)
.with_prompt_batchsize(prompt_batchsize)
Expand Down Expand Up @@ -477,7 +479,7 @@ fn main() -> anyhow::Result<()> {
let pipeline = loader.load_model_from_hf(
None,
token_source,
&ModelDType::Auto,
&dtype,
&device,
false,
mapper,
Expand Down
Loading