mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 19:28:12 +08:00
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:
committed by
Keavon Chambers
parent
61c5dd1f88
commit
3c2d371173
@@ -121,7 +121,7 @@ impl SpirVCompiler for GpuCompiler {
|
||||
|
||||
pub fn serialize_gpu(networks: &[ProtoNetwork], io: &ShaderIO) -> anyhow::Result<String> {
|
||||
fn nid(id: &u64) -> String {
|
||||
format!("n{id}")
|
||||
format!("n{id:0x}")
|
||||
}
|
||||
|
||||
dbg!(&io);
|
||||
@@ -151,13 +151,13 @@ pub fn serialize_gpu(networks: &[ProtoNetwork], io: &ShaderIO) -> anyhow::Result
|
||||
}
|
||||
for (i, id) in network.inputs.iter().enumerate() {
|
||||
let Some((_, node)) = network.nodes.iter().find(|(i, _)| i == id) else {
|
||||
anyhow::bail!("Input node not found");
|
||||
};
|
||||
anyhow::bail!("Input node not found");
|
||||
};
|
||||
let fqn = &node.identifier.name;
|
||||
let id = nid(id);
|
||||
let node = Node {
|
||||
id: id.clone(),
|
||||
index: i,
|
||||
index: i + 2,
|
||||
fqn: fqn.to_string().split('<').next().unwrap().to_owned(),
|
||||
args: node.construction_args.new_function_args(),
|
||||
};
|
||||
@@ -202,7 +202,7 @@ pub fn serialize_gpu(networks: &[ProtoNetwork], io: &ShaderIO) -> anyhow::Result
|
||||
context.insert("input_nodes", &input_nodes);
|
||||
context.insert("output_nodes", &output_nodes);
|
||||
context.insert("nodes", &nodes);
|
||||
context.insert("compute_threads", &64);
|
||||
context.insert("compute_threads", "12, 8");
|
||||
Ok(tera.render("spirv", &context)?)
|
||||
}
|
||||
|
||||
@@ -215,9 +215,13 @@ pub fn compile(dir: &Path) -> Result<spirv_builder::CompileResult, spirv_builder
|
||||
.preserve_bindings(true)
|
||||
.release(true)
|
||||
.spirv_metadata(SpirvMetadata::Full)
|
||||
//.extra_arg("no-early-report-zombies")
|
||||
//.extra_arg("no-infer-storage-classes")
|
||||
//.extra_arg("spirt-passes=qptr")
|
||||
//.scalar_block_layout(true)
|
||||
.relax_logical_pointer(true)
|
||||
//.capability(spirv_builder::Capability::Float64)
|
||||
//.capability(spirv_builder::Capability::VariablePointersStorageBuffer)
|
||||
.extra_arg("no-early-report-zombies")
|
||||
.extra_arg("no-infer-storage-classes")
|
||||
.extra_arg("spirt-passes=qptr")
|
||||
.build()?;
|
||||
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user