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

Add --disable-sgmv flag #639

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and push docker image to ghcr

on:
pull_request:
joseph-predibase marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:
push:
branches:
Expand Down
9 changes: 9 additions & 0 deletions launcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ struct Args {
/// The embedding dimension to use for the model.
#[clap(long, env)]
embedding_dim: Option<usize>,

#[clap(long, env)]
disable_sgmv: bool,
}

#[derive(Debug)]
Expand Down Expand Up @@ -500,6 +503,7 @@ fn shard_manager(
shutdown: Arc<AtomicBool>,
_shutdown_sender: mpsc::Sender<()>,
embedding_dim: Option<usize>,
disable_sgmv: bool,
) {
// Enter shard-manager tracing span
let _span = tracing::span!(tracing::Level::INFO, "shard-manager", rank = rank).entered();
Expand Down Expand Up @@ -608,6 +612,7 @@ fn shard_manager(
shard_args.push(embedding_dim.to_string())
}


// Copy current process env
let mut envs: Vec<(OsString, OsString)> = env::vars_os().collect();

Expand Down Expand Up @@ -640,6 +645,10 @@ fn shard_manager(
envs.push(("FLASH_INFER".into(), "1".into()));
}

if disable_sgmv {
envs.push(("DISABLE_SGMV".into(), "1".into()))
}

// Safetensors load fast
envs.push(("SAFETENSORS_FAST_GPU".into(), "1".into()));

Expand Down
1 change: 1 addition & 0 deletions server/lorax_server/utils/sgmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import punica_kernels as _kernels

HAS_SGMV = not bool(os.environ.get("DISABLE_SGMV", ""))
print("HAS_SGMV: ", HAS_SGMV)
joseph-predibase marked this conversation as resolved.
Show resolved Hide resolved
except ImportError:
warnings.warn("Could not import SGMV kernel from Punica, falling back to loop.")
_kernels = None
Expand Down
Loading