Comments (1)
in principle there are two approaches to implement subdomains. Either using a stencil.combine to combine multiple applies operation or by defining subdomains inside the stencil apply operator.
- stencil.combine
%version1 = stencil.apply
%version2 = stencil.apply
%0 = stencil.combine 2 15 %version1 %version2 on ([0,0,0]:[64,64,60]) : (stencil.temp stencil.temp) -> stencil.temp
this example executes the stencil 1 if dimension k is < 15 and 2 otherwise. The operation is a normal shaped op and we need to extend the access analysis to infer the shape for the two inputs version1 and version2. Additionally we need a verifier that ensures the all both version1 and version2 have only one use. That way the stencil combines are tightly coupled to the stencil apply.
the advantage of the stencil.combine is that we can bubble the combines down in the chain of stencil apply operators. Similarly to hoisting the if / else in an if / else based approach and we can decide if we want to generate if/else or different kernels that run in streams. Additionally due to the bubbling we can use the existing stencil inlining pass at least in theory. We may run into trouble since a single evaluation of the output stencil may have to run multiple versions of the inlined stencil if the inlined stencil is a combination of two stencils.
- introduce splits inside the stencil operator.
%0 = stencil.apply {
%res = stencil.split 0 in LB to 5 {
// version1
stencil.yield %version1
} and 5 to UB {
// version2
stencil.yield %version2
}
stencil.return %res
}
this example implements a similar split as above and the splits could be nested. This syntax does not change the stencil.apply on the course grained level and is similar to what we may use for the tridiagonal solves. However inlining and possibly onrolling again becomes complicating and potentially more complicating than for the stencil.combine. We may allow the stencil combine to have more or less than two bodies to get a cleaner result and less nesting. However, one split shall split only one dimension.
The placeholders LB and UB specify the lower and upper bounds of the parent stencil.apply
from open-earth-compiler.
Related Issues (20)
- Instruction count difference compared to reference HOT 1
- Add continuous integration HOT 2
- Support any unroll factor
- CMake needs to include CUDA directories HOT 5
- Change stencil.assert to stencil.cast with a return value
- tridiagonal solvers
- explicit intermediate storage to prevent fusion of long stencil chains HOT 1
- if/else optimization
- add stencil access that support dynamic offsets given some constant bound HOT 1
- operation to access a lower dimensional slice
- add the possiblity to load and store from and to the same field HOT 1
- Interleaved unrolling
- String-based OpBuilder removed HOT 4
- cmake error: too many arguments to function createGpuToLLVMConversionPass HOT 2
- problem about laplace example in readme HOT 2
- [mlir]the ptx compilation flow HOT 2
- problem about compiling fastwaves.mlir HOT 2
- stencil-shape-inference is not working with tridiagonal example HOT 3
- status of project HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-earth-compiler.