Graphene CLI + quantization research (#1320)

* Implement skeleton for graphene-cli

* Configure gpu surface on non wasm32 targets

* Create window with full hd size

* Create window using the graphen-cli

* Use window size for surface creation

* Reuse surface configuration

* Reduce window size for native applications to 800x600

* Add compute pipeline test

* Poll wgpu execution externally

* Remove cache node after texture upload

* Add profiling instructions

* Add more debug markers

* Evaluate extract node before flattening the network

* Reenable hue saturation node for compilation

* Make hue saturation node work on the gpu + make f32 default for user inputs

* Add version of test files without caching

* Only dispatch each workgroup not pixel

* ICE

* Add quantization to gpu code

* Fix quantization

* Load images at graph runtime

* Fix quantization calculation

* Feature gate quantization

* Use git version of autoquant

* Add license to `graphene-cli`

* Fix graphene-cli test case

* Ignore tests on non unix platforms

* Fix flattening test
This commit is contained in:
Dennis Kobert
2023-07-04 17:04:09 +02:00
committed by Keavon Chambers
parent 61c5dd1f88
commit 3c2d371173
57 changed files with 10169 additions and 845 deletions

View File

@@ -357,12 +357,23 @@ where
/// A struct representing a compute pipeline.
pub struct PipelineLayout<E: GpuExecutor + ?Sized> {
pub shader: E::ShaderHandle,
pub shader: Arc<E::ShaderHandle>,
pub entry_point: String,
pub bind_group: Bindgroup<E>,
pub bind_group: Arc<Bindgroup<E>>,
pub output_buffer: Arc<ShaderInput<E>>,
}
impl<E: GpuExecutor + ?Sized> Clone for PipelineLayout<E> {
fn clone(&self) -> Self {
Self {
shader: self.shader.clone(),
entry_point: self.entry_point.clone(),
bind_group: self.bind_group.clone(),
output_buffer: self.output_buffer.clone(),
}
}
}
unsafe impl<E: GpuExecutor + ?Sized + StaticType> StaticType for PipelineLayout<E>
where
E::Static: GpuExecutor,
@@ -457,9 +468,9 @@ pub struct CreatePipelineLayoutNode<_E, EntryPoint, Bindgroup, OutputBuffer> {
#[node_macro::node_fn(CreatePipelineLayoutNode<_E>)]
async fn create_pipeline_layout_node<_E: GpuExecutor>(shader: _E::ShaderHandle, entry_point: String, bind_group: Bindgroup<_E>, output_buffer: Arc<ShaderInput<_E>>) -> PipelineLayout<_E> {
PipelineLayout {
shader,
shader: shader.into(),
entry_point,
bind_group,
bind_group: bind_group.into(),
output_buffer,
}
}
@@ -520,6 +531,7 @@ where
#[node_macro::node_fn(RenderTextureNode)]
async fn render_texture_node<'a: 'input, E: 'a + GpuExecutor>(image: ShaderInputFrame<E>, surface: Arc<SurfaceHandle<E::Surface>>, executor: &'a E) -> SurfaceFrame {
let surface_id = surface.surface_id;
log::trace!("rendering to surface {:?}", surface_id);
executor.create_render_pass(image.shader_input, surface).unwrap();