Skip to content

Commit

Permalink
Update elementwise_fusion.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
jafioti authored Oct 9, 2024
1 parent caa7e55 commit d311003
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/luminal_metal/src/elementwise_fusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ impl<T: MetalFloat> FusedElementwiseOp<T> {
.collect()
})
.collect();
println!("Stacked: {:?}", stacked_shapes);
// Stack index expressions
let stacked_index_expressions_partial = stacked_shapes
.iter()
Expand Down Expand Up @@ -481,14 +480,12 @@ impl<T: MetalFloat> FusedElementwiseOp<T> {
.zip(&stacked_shapes)
.map(|(partial, sh)| sh[0].valid_expression().substitute('z', partial).simplify())
.collect::<Vec<_>>();
println!("M");

// Replace in subexpressions
let n_subexpressions = subexpressions.len();
for (i, ((subexp, _), stacked_shapes)) in
subexpressions.iter_mut().zip(subexp_views).enumerate()
{
println!("{i}");
// Index
for (i, (ind_exp, val_exp)) in stacked_index_expressions
.iter()
Expand All @@ -501,13 +498,10 @@ impl<T: MetalFloat> FusedElementwiseOp<T> {
input_regexes.insert(i, Regex::new(&format!(r"input{i}([^0-9]|$)")).unwrap());
input_regexes.get(&i).unwrap()
};
// println!("ORIG: {ind_exp}");
let (ind, val) = (
ind_exp.simplify_cache(simplification_cache),
val_exp.simplify_cache(simplification_cache),
);
// println!("\n\n\n\n\n\nSIMP: {ind}");
println!("S {} -> {}", ind_exp.len(), ind.len());
*subexp = re
.replace_all(
subexp,
Expand Down

0 comments on commit d311003

Please sign in to comment.