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

Update tch to 0.15 #443

Merged
merged 4 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove torch-sys dependency from benches
  • Loading branch information
guillaume-be committed Feb 11, 2024
commit b0849adaa8c5d8598262819ae52812b608d019a0
4 changes: 0 additions & 4 deletions benches/generation_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ fn generation_forward_pass(iters: u64, model: &TextGenerationModel, data: &[&str
}

fn bench_generation(c: &mut Criterion) {
// Set-up summarization model
unsafe {
torch_sys::dummy_cuda_dependency();
}
let model = create_text_generation_model();

// Define input
Expand Down
4 changes: 1 addition & 3 deletions benches/squad_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ fn qa_load_model(iters: u64) -> Duration {
fn bench_squad(c: &mut Criterion) {
// Set-up QA model
let model = create_qa_model();
unsafe {
torch_sys::dummy_cuda_dependency();
}

// Define input
let mut squad_path = PathBuf::from(env::var("squad_dataset")
.expect("Please set the \"squad_dataset\" environment variable pointing to the SQuAD dataset folder"));
Expand Down
4 changes: 1 addition & 3 deletions benches/sst2_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ fn sst2_load_model(iters: u64) -> Duration {
fn bench_sst2(c: &mut Criterion) {
// Set-up classifier
let model = create_sentiment_model();
unsafe {
torch_sys::dummy_cuda_dependency();
}

// Define input
let mut sst2_path = PathBuf::from(env::var("SST2_PATH").expect(
"Please set the \"SST2_PATH\" environment variable pointing to the SST2 dataset folder",
Expand Down
3 changes: 0 additions & 3 deletions benches/summarization_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ fn summarization_load_model(iters: u64) -> Duration {

fn bench_squad(c: &mut Criterion) {
// Set-up summarization model
unsafe {
torch_sys::dummy_cuda_dependency();
}
let model = create_summarization_model();

// Define input
Expand Down
4 changes: 0 additions & 4 deletions benches/tensor_operations_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ fn matrix_multiply(iters: u64, input: &Tensor, weights: &Tensor) -> Duration {
}

fn bench_tensor_ops(c: &mut Criterion) {
// Set-up summarization model
unsafe {
torch_sys::dummy_cuda_dependency();
}
let input = Tensor::rand([32, 128, 512], (Kind::Float, Device::cuda_if_available()));
let weights = Tensor::rand([512, 512], (Kind::Float, Device::cuda_if_available()));

Expand Down
3 changes: 0 additions & 3 deletions benches/token_classification_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ fn create_model() -> TokenClassificationModel {

fn bench_token_classification_predict(c: &mut Criterion) {
// Set-up model
unsafe {
torch_sys::dummy_cuda_dependency();
}
let model = create_model();

// Define input
Expand Down
3 changes: 0 additions & 3 deletions benches/translation_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ fn translation_load_model(iters: u64) -> Duration {

fn bench_squad(c: &mut Criterion) {
// Set-up translation model
unsafe {
torch_sys::dummy_cuda_dependency();
}
let model = create_translation_model();

// Define input
Expand Down
Loading