Skip to content

Commit

Permalink
Force f16 if OpenCL is on, because otherwise we will crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noeda committed Apr 6, 2023
1 parent 746fc56 commit f5328ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rllama_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
DataSettings::new()
};

if cli.f16 {
if cli.f16 || opencl.is_some() {
data_settings = data_settings.force_f16();
}

Expand Down
5 changes: 4 additions & 1 deletion src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,10 @@ impl Tensor {
);
}
if src.dtype != other.dtype {
panic!("Invalid matrix multiplication, different dtypes");
panic!(
"Invalid matrix multiplication, different dtypes: {:?} vs {:?}",
src.dtype, other.dtype
);
}
if self.rows != src.rows {
panic!("Invalid matrix multiplication, different number of rows");
Expand Down

0 comments on commit f5328ab

Please sign in to comment.