Skip to content
New issue

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

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

Already on GitHub? # to your account

[DRAFT] Feat/vptq proto #1627

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
20 changes: 10 additions & 10 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
//! tract-tensorflow or tract-onnx crates.
//!

#[cfg(feature="blas")]
extern crate cblas;
#[cfg(feature="accelerate")]
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature="blis")]
#[cfg(feature = "blis")]
extern crate blis_src;
#[cfg(feature="openblas")]
#[cfg(feature = "blas")]
extern crate cblas;
#[cfg(feature = "openblas")]
extern crate openblas_src;

extern crate bit_set;
Expand Down Expand Up @@ -81,8 +81,8 @@ pub mod ops;

pub mod axes;
pub mod broadcast;
pub mod framework;
pub mod floats;
pub mod framework;
pub mod model;
pub mod optim;
pub mod plan;
Expand All @@ -98,7 +98,7 @@ mod late_bind;
pub mod prelude {
pub use crate::framework::Framework;
pub use crate::model::*;
pub use crate::plan::{SimplePlan, SimpleState, PlanOptions};
pub use crate::plan::{PlanOptions, SimplePlan, SimpleState};
pub use crate::value::{IntoTValue, TValue};
pub use std::sync::Arc;
pub use tract_data::prelude::*;
Expand All @@ -118,8 +118,9 @@ pub mod internal {
pub use crate::ops::change_axes::*;
pub use crate::ops::element_wise::ElementWiseMiniOp;
pub use crate::ops::{Cost, EvalOp, FrozenOpState, Op, OpState, Validation};
pub use crate::plan::{ SessionState, SessionStateHandler };
pub use crate::plan::{SessionState, SessionStateHandler};
pub use crate::prelude::*;
pub use crate::runtime::{DefaultRuntime, Runnable, Runtime, State};
pub use dims;
pub use downcast_rs as tract_downcast_rs;
pub use std::borrow::Cow;
Expand All @@ -131,10 +132,9 @@ pub mod internal {
dispatch_copy, dispatch_datum, dispatch_datum_by_size, dispatch_floatlike, dispatch_numbers,
};
pub use tvec;
pub use {args_1, args_2, args_3, args_4, args_5, args_6, args_7, args_8};
pub use {args_1, args_2, args_3, args_4, args_5, args_6, args_7, args_8, args_9};
pub use {as_op, impl_op_same_as, not_a_typed_op, op_as_typed_op};
pub use {bin_to_super_type, element_wise, element_wise_oop};
pub use crate::runtime::{Runtime, Runnable, State, DefaultRuntime};
}

#[cfg(test)]
Expand Down
25 changes: 24 additions & 1 deletion core/src/ops/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,30 @@ macro_rules! args_8 {
}};
}

#[allow(unused_macros)]
#[macro_export]
macro_rules! args_9 {
($inputs:expr) => {{
let mut inputs = $inputs;
if inputs.len() != 9 {
$crate::internal::bail!("Expected 9 arg, got {:?}", inputs)
}
inputs.reverse();
let result = (
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
inputs.pop().unwrap(),
);
result
}};
}

#[macro_export]
macro_rules! impl_op_same_as {
() => {
Expand Down Expand Up @@ -233,4 +257,3 @@ macro_rules! trivial_op_state_freeeze {
}
};
}

1 change: 1 addition & 0 deletions core/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mod scan;
pub mod source;
pub mod submodel;
pub mod unimpl;
pub mod vptq;

pub use downsample::Downsample;
pub use memory::*;
Expand Down
Loading
Loading