weft-core 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. weft_core-0.2.0/.gitattributes +10 -0
  2. weft_core-0.2.0/.gitignore +33 -0
  3. weft_core-0.2.0/CMakeLists.txt +138 -0
  4. weft_core-0.2.0/CONTRIBUTING.md +33 -0
  5. weft_core-0.2.0/LICENSE +202 -0
  6. weft_core-0.2.0/NOTICE +6 -0
  7. weft_core-0.2.0/PKG-INFO +249 -0
  8. weft_core-0.2.0/README.md +39 -0
  9. weft_core-0.2.0/README.zh-CN.md +13 -0
  10. weft_core-0.2.0/SECURITY.md +30 -0
  11. weft_core-0.2.0/THIRD_PARTY_NOTICES.md +49 -0
  12. weft_core-0.2.0/cmake/NativeToolchain.cmake +72 -0
  13. weft_core-0.2.0/cmake/WeftCompilerConfig.cmake +8 -0
  14. weft_core-0.2.0/cmake/WeftConfig.cmake +9 -0
  15. weft_core-0.2.0/cmake/weft_version.py +49 -0
  16. weft_core-0.2.0/include/CMakeLists.txt +1 -0
  17. weft_core-0.2.0/include/Weft/Analysis/IndexRelations.h +13 -0
  18. weft_core-0.2.0/include/Weft/Analysis/IntegerFacts.h +64 -0
  19. weft_core-0.2.0/include/Weft/Analysis/LogicalAxes.h +42 -0
  20. weft_core-0.2.0/include/Weft/Analysis/PhysicalDependence.h +61 -0
  21. weft_core-0.2.0/include/Weft/Analysis/ReductionIdentity.h +29 -0
  22. weft_core-0.2.0/include/Weft/Analysis/StorageBytes.h +50 -0
  23. weft_core-0.2.0/include/Weft/Analysis/StorageLifetime.h +42 -0
  24. weft_core-0.2.0/include/Weft/CMakeLists.txt +1 -0
  25. weft_core-0.2.0/include/Weft/Dialect/CMakeLists.txt +2 -0
  26. weft_core-0.2.0/include/Weft/Dialect/Kernel/CMakeLists.txt +1 -0
  27. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/Atomic.h +32 -0
  28. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/CMakeLists.txt +8 -0
  29. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/EncodingStorage.h +51 -0
  30. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/KernelDialect.h +64 -0
  31. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/KernelInterface.h +17 -0
  32. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/KernelOps.td +497 -0
  33. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/ReductionRegion.h +57 -0
  34. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/ShapeBindings.h +20 -0
  35. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/StrideABI.h +39 -0
  36. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/SubviewBounds.h +76 -0
  37. weft_core-0.2.0/include/Weft/Dialect/Kernel/IR/TypeQueries.h +14 -0
  38. weft_core-0.2.0/include/Weft/Dialect/Kernel/Transforms/SourceSpecialization.h +24 -0
  39. weft_core-0.2.0/include/Weft/Dialect/RISCV/CMakeLists.txt +1 -0
  40. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/CMakeLists.txt +10 -0
  41. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Contraction.h +24 -0
  42. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/DenseBounds.h +40 -0
  43. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/DenseRelations.h +38 -0
  44. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/DenseSegments.h +30 -0
  45. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/FMAIssue.h +49 -0
  46. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Fragment.h +43 -0
  47. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Layout.h +123 -0
  48. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/LocalTransfer.h +14 -0
  49. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Memory.h +132 -0
  50. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/MemoryEffects.h +19 -0
  51. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Numerics.h +38 -0
  52. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/PanelTransfer.h +24 -0
  53. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Predicate.h +19 -0
  54. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/RISCVDialect.h +122 -0
  55. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/RISCVOps.td +2628 -0
  56. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/RISCVOpsTraits.h +17 -0
  57. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/ScalarPacket.h +18 -0
  58. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/Stream.h +40 -0
  59. weft_core-0.2.0/include/Weft/Dialect/RISCV/IR/VectorTile.h +48 -0
  60. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVCompilation.h +88 -0
  61. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVCompiler.h +203 -0
  62. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVDataCache.h +40 -0
  63. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVExtensions.h +44 -0
  64. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVFragment.h +70 -0
  65. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVPasses.h +78 -0
  66. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVPipeline.h +111 -0
  67. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVTargetCatalog.h +19 -0
  68. weft_core-0.2.0/include/Weft/Target/RISCV/RISCVTargetProfile.h +116 -0
  69. weft_core-0.2.0/include/Weft/Target/X86/X86Compiler.h +51 -0
  70. weft_core-0.2.0/include/Weft/Target/X86/X86Target.h +53 -0
  71. weft_core-0.2.0/include/Weft/Transforms/ExpF32.h +15 -0
  72. weft_core-0.2.0/include/Weft/Transforms/FullTiles.h +24 -0
  73. weft_core-0.2.0/include/Weft/Transforms/LoopPipeline.h +97 -0
  74. weft_core-0.2.0/integrations/llama.cpp/WeftLlama.cmake +9 -0
  75. weft_core-0.2.0/integrations/llama.cpp/adapter.cpp +673 -0
  76. weft_core-0.2.0/integrations/llama.cpp/include/weft/ggml.h +109 -0
  77. weft_core-0.2.0/lib/Analysis/CMakeLists.txt +10 -0
  78. weft_core-0.2.0/lib/Analysis/IndexRelations.cpp +202 -0
  79. weft_core-0.2.0/lib/Analysis/IntegerFacts.cpp +353 -0
  80. weft_core-0.2.0/lib/Analysis/LogicalAxes.cpp +72 -0
  81. weft_core-0.2.0/lib/Analysis/PhysicalDependence.cpp +159 -0
  82. weft_core-0.2.0/lib/Analysis/StorageBytes.cpp +187 -0
  83. weft_core-0.2.0/lib/Analysis/StorageLifetime.cpp +149 -0
  84. weft_core-0.2.0/lib/CMakeLists.txt +44 -0
  85. weft_core-0.2.0/lib/Compiler/CMakeLists.txt +16 -0
  86. weft_core-0.2.0/lib/Compiler/Compiler.cpp +568 -0
  87. weft_core-0.2.0/lib/Compiler/exports.map +4 -0
  88. weft_core-0.2.0/lib/Dialect/CMakeLists.txt +2 -0
  89. weft_core-0.2.0/lib/Dialect/Kernel/CMakeLists.txt +2 -0
  90. weft_core-0.2.0/lib/Dialect/Kernel/IR/CMakeLists.txt +19 -0
  91. weft_core-0.2.0/lib/Dialect/Kernel/IR/ControlOps.cpp +345 -0
  92. weft_core-0.2.0/lib/Dialect/Kernel/IR/EncodingOps.cpp +319 -0
  93. weft_core-0.2.0/lib/Dialect/Kernel/IR/KernelDialect.cpp +46 -0
  94. weft_core-0.2.0/lib/Dialect/Kernel/IR/KernelInterface.cpp +165 -0
  95. weft_core-0.2.0/lib/Dialect/Kernel/IR/KernelTypes.cpp +99 -0
  96. weft_core-0.2.0/lib/Dialect/Kernel/IR/MemoryOps.cpp +338 -0
  97. weft_core-0.2.0/lib/Dialect/Kernel/IR/NumericOps.cpp +430 -0
  98. weft_core-0.2.0/lib/Dialect/Kernel/IR/TypeQueries.cpp +71 -0
  99. weft_core-0.2.0/lib/Dialect/Kernel/IR/Verification.cpp +420 -0
  100. weft_core-0.2.0/lib/Dialect/Kernel/IR/Verification.h +71 -0
  101. weft_core-0.2.0/lib/Dialect/Kernel/Transforms/BindSourceParameters.cpp +162 -0
  102. weft_core-0.2.0/lib/Dialect/Kernel/Transforms/CMakeLists.txt +2 -0
  103. weft_core-0.2.0/lib/Dialect/Kernel/Transforms/NormalizeControl.cpp +707 -0
  104. weft_core-0.2.0/lib/Dialect/RISCV/CMakeLists.txt +1 -0
  105. weft_core-0.2.0/lib/Dialect/RISCV/IR/CMakeLists.txt +35 -0
  106. weft_core-0.2.0/lib/Dialect/RISCV/IR/Contraction.cpp +155 -0
  107. weft_core-0.2.0/lib/Dialect/RISCV/IR/ContractionSelection.cpp +135 -0
  108. weft_core-0.2.0/lib/Dialect/RISCV/IR/Coordinates.cpp +140 -0
  109. weft_core-0.2.0/lib/Dialect/RISCV/IR/DenseBounds.cpp +530 -0
  110. weft_core-0.2.0/lib/Dialect/RISCV/IR/DenseRelations.cpp +255 -0
  111. weft_core-0.2.0/lib/Dialect/RISCV/IR/DenseSegments.cpp +137 -0
  112. weft_core-0.2.0/lib/Dialect/RISCV/IR/FMAIssue.cpp +326 -0
  113. weft_core-0.2.0/lib/Dialect/RISCV/IR/FieldView.cpp +133 -0
  114. weft_core-0.2.0/lib/Dialect/RISCV/IR/FragmentOps.cpp +1225 -0
  115. weft_core-0.2.0/lib/Dialect/RISCV/IR/Layout.cpp +1139 -0
  116. weft_core-0.2.0/lib/Dialect/RISCV/IR/LocalTransferOps.cpp +175 -0
  117. weft_core-0.2.0/lib/Dialect/RISCV/IR/Memory.cpp +1089 -0
  118. weft_core-0.2.0/lib/Dialect/RISCV/IR/Numerics.cpp +290 -0
  119. weft_core-0.2.0/lib/Dialect/RISCV/IR/PanelTransfer.cpp +175 -0
  120. weft_core-0.2.0/lib/Dialect/RISCV/IR/PointerMemory.cpp +119 -0
  121. weft_core-0.2.0/lib/Dialect/RISCV/IR/Predicate.cpp +159 -0
  122. weft_core-0.2.0/lib/Dialect/RISCV/IR/RISCVDialect.cpp +11228 -0
  123. weft_core-0.2.0/lib/Dialect/RISCV/IR/ScalarPacket.cpp +131 -0
  124. weft_core-0.2.0/lib/Dialect/RISCV/IR/StreamOps.cpp +303 -0
  125. weft_core-0.2.0/lib/Dialect/RISCV/IR/VectorTile.cpp +312 -0
  126. weft_core-0.2.0/lib/Dialect/RISCV/IR/Verification.cpp +79 -0
  127. weft_core-0.2.0/lib/Dialect/RISCV/IR/Verification.h +15 -0
  128. weft_core-0.2.0/lib/Runtime/API.cpp +248 -0
  129. weft_core-0.2.0/lib/Runtime/APIBoundary.h +39 -0
  130. weft_core-0.2.0/lib/Runtime/Binding.cpp +174 -0
  131. weft_core-0.2.0/lib/Runtime/CMakeLists.txt +13 -0
  132. weft_core-0.2.0/lib/Runtime/CallContract.cpp +142 -0
  133. weft_core-0.2.0/lib/Runtime/Internal.h +223 -0
  134. weft_core-0.2.0/lib/Runtime/Layout.cpp +134 -0
  135. weft_core-0.2.0/lib/Runtime/Library.cpp +350 -0
  136. weft_core-0.2.0/lib/Runtime/Metadata.cpp +148 -0
  137. weft_core-0.2.0/lib/Runtime/Parallel.cpp +208 -0
  138. weft_core-0.2.0/lib/Runtime/Resources.cpp +225 -0
  139. weft_core-0.2.0/lib/Runtime/ggml-threadpool-LICENSE +29 -0
  140. weft_core-0.2.0/lib/Target/CMakeLists.txt +2 -0
  141. weft_core-0.2.0/lib/Target/RISCV/Analysis/ControlStorage.cpp +349 -0
  142. weft_core-0.2.0/lib/Target/RISCV/Analysis/ControlStorage.h +13 -0
  143. weft_core-0.2.0/lib/Target/RISCV/Analysis/LocalLifetime.cpp +233 -0
  144. weft_core-0.2.0/lib/Target/RISCV/Analysis/LocalLifetime.h +18 -0
  145. weft_core-0.2.0/lib/Target/RISCV/Analysis/LocalMemory.cpp +453 -0
  146. weft_core-0.2.0/lib/Target/RISCV/Analysis/LocalMemory.h +93 -0
  147. weft_core-0.2.0/lib/Target/RISCV/Analysis/LocalStorageFootprint.cpp +77 -0
  148. weft_core-0.2.0/lib/Target/RISCV/Analysis/MemoryBounds.cpp +123 -0
  149. weft_core-0.2.0/lib/Target/RISCV/Analysis/PhysicalLoopControl.cpp +96 -0
  150. weft_core-0.2.0/lib/Target/RISCV/Analysis/PhysicalLoopControl.h +30 -0
  151. weft_core-0.2.0/lib/Target/RISCV/Analysis/ValueLiveness.cpp +393 -0
  152. weft_core-0.2.0/lib/Target/RISCV/Analysis/ValueLiveness.h +83 -0
  153. weft_core-0.2.0/lib/Target/RISCV/Backend/PhysicalDiagnostics.cpp +139 -0
  154. weft_core-0.2.0/lib/Target/RISCV/Backend/PhysicalDiagnostics.h +8 -0
  155. weft_core-0.2.0/lib/Target/RISCV/Backend/RISCVCompilation.cpp +171 -0
  156. weft_core-0.2.0/lib/Target/RISCV/Backend/RISCVCompiler.cpp +235 -0
  157. weft_core-0.2.0/lib/Target/RISCV/Backend/RISCVCompilerOptions.cpp +59 -0
  158. weft_core-0.2.0/lib/Target/RISCV/Backend/RISCVPipeline.cpp +720 -0
  159. weft_core-0.2.0/lib/Target/RISCV/CMakeLists.txt +128 -0
  160. weft_core-0.2.0/lib/Target/RISCV/Conversion/ConvertWeftToRISCV.cpp +1792 -0
  161. weft_core-0.2.0/lib/Target/RISCV/Emission/Control.cpp +982 -0
  162. weft_core-0.2.0/lib/Target/RISCV/Emission/Emitter.h +1105 -0
  163. weft_core-0.2.0/lib/Target/RISCV/Emission/Encoding.cpp +1873 -0
  164. weft_core-0.2.0/lib/Target/RISCV/Emission/FMAIssues.cpp +169 -0
  165. weft_core-0.2.0/lib/Target/RISCV/Emission/FieldStorage.cpp +373 -0
  166. weft_core-0.2.0/lib/Target/RISCV/Emission/Functions.cpp +160 -0
  167. weft_core-0.2.0/lib/Target/RISCV/Emission/IME.cpp +1028 -0
  168. weft_core-0.2.0/lib/Target/RISCV/Emission/Layout.cpp +1484 -0
  169. weft_core-0.2.0/lib/Target/RISCV/Emission/Memory.cpp +2351 -0
  170. weft_core-0.2.0/lib/Target/RISCV/Emission/Predicates.cpp +170 -0
  171. weft_core-0.2.0/lib/Target/RISCV/Emission/RISCVIntrinsicC.cpp +112 -0
  172. weft_core-0.2.0/lib/Target/RISCV/Emission/RISCVIntrinsicC.h +20 -0
  173. weft_core-0.2.0/lib/Target/RISCV/Emission/RVVArithmetic.cpp +2622 -0
  174. weft_core-0.2.0/lib/Target/RISCV/Emission/RVVBitplanes.cpp +659 -0
  175. weft_core-0.2.0/lib/Target/RISCV/Emission/RVVContraction.cpp +1576 -0
  176. weft_core-0.2.0/lib/Target/RISCV/Emission/RVVMemory.cpp +1863 -0
  177. weft_core-0.2.0/lib/Target/RISCV/Emission/RVVPartial.cpp +1094 -0
  178. weft_core-0.2.0/lib/Target/RISCV/Emission/ScalarControl.cpp +203 -0
  179. weft_core-0.2.0/lib/Target/RISCV/Emission/Support.cpp +124 -0
  180. weft_core-0.2.0/lib/Target/RISCV/Emission/VectorTiles.cpp +496 -0
  181. weft_core-0.2.0/lib/Target/RISCV/Extensions/CMakeLists.txt +24 -0
  182. weft_core-0.2.0/lib/Target/RISCV/Extensions/SpacemitIME1/Contracts.cpp +38 -0
  183. weft_core-0.2.0/lib/Target/RISCV/Extensions/SpacemitIME1/Emission.cpp +51 -0
  184. weft_core-0.2.0/lib/Target/RISCV/Extensions/SpacemitIME2/Contracts.cpp +61 -0
  185. weft_core-0.2.0/lib/Target/RISCV/Extensions/SpacemitIME2/Emission.cpp +55 -0
  186. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentEmission.cpp +38 -0
  187. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentEmission.h +19 -0
  188. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentMaterialization.cpp +793 -0
  189. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentMaterialization.h +13 -0
  190. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentSupply.cpp +419 -0
  191. weft_core-0.2.0/lib/Target/RISCV/IME/FragmentSupply.h +15 -0
  192. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVDataCache.cpp +20 -0
  193. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVExtensions.cpp +131 -0
  194. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVFragment.cpp +13 -0
  195. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVISA.cpp +39 -0
  196. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVNativeCache.cpp +133 -0
  197. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVNativeTarget.cpp +224 -0
  198. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVTargetCatalog.cpp +125 -0
  199. weft_core-0.2.0/lib/Target/RISCV/Platform/RISCVTargetProfile.cpp +219 -0
  200. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/ContractRISCVIntegerPointwise.cpp +196 -0
  201. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/FinalizeRISCVLeaves.cpp +1255 -0
  202. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/FuseRISCVBitplanes.cpp +935 -0
  203. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/MaterializeRISCVGroupedArithmetic.cpp +445 -0
  204. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/MaterializeRISCVNumericConversions.cpp +134 -0
  205. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/MaterializeRISCVReductionBounds.cpp +201 -0
  206. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/MaterializeRISCVReductions.cpp +332 -0
  207. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/NumericConversions.h +8 -0
  208. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/Partial/AddTrees.cpp +657 -0
  209. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/Partial/Materialize.cpp +2665 -0
  210. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/Partial/PlanTopologies.cpp +1428 -0
  211. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/Partial/Support.cpp +4513 -0
  212. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/Partial/Support.h +418 -0
  213. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/PredicateRegisters.cpp +335 -0
  214. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/PredicateRegisters.h +10 -0
  215. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/ReductionBounds.h +9 -0
  216. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/SelectRISCVOperations.cpp +1145 -0
  217. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/SelectRISCVScalarLoadPrimes.cpp +150 -0
  218. weft_core-0.2.0/lib/Target/RISCV/Transforms/Arithmetic/SelectRISCVScalarPackets.cpp +219 -0
  219. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/ContractRISCVFloatingPoint.cpp +149 -0
  220. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/ContractionSupply.cpp +436 -0
  221. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/ContractionSupply.h +64 -0
  222. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseContractionEpilogue.cpp +353 -0
  223. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseContractionEpilogue.h +40 -0
  224. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseContractions.cpp +2255 -0
  225. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseContractions.h +15 -0
  226. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseIssue.cpp +232 -0
  227. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseIssue.h +44 -0
  228. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DensePanelTransfer.cpp +209 -0
  229. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DensePanelTransfer.h +36 -0
  230. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseProducerGraph.cpp +747 -0
  231. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseProducerGraph.h +64 -0
  232. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseTransfer.cpp +148 -0
  233. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/DenseTransfer.h +33 -0
  234. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/PanelTransferSelection.cpp +86 -0
  235. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/SelectRISCVFMAIssues.cpp +251 -0
  236. weft_core-0.2.0/lib/Target/RISCV/Transforms/Contraction/SelectRISCVPanelTransfers.cpp +124 -0
  237. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/FinalizeRISCVHelpers.cpp +130 -0
  238. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/FuseRISCVPhysicalIssueLoops.cpp +276 -0
  239. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/HoistRISCVLoopInvariants.cpp +230 -0
  240. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/PipelineRISCVLevels.cpp +111 -0
  241. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/PipelineSchedule.cpp +1041 -0
  242. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/PipelineSchedule.h +73 -0
  243. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/PipelineShapeBindings.cpp +211 -0
  244. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/PipelineShapeBindings.h +30 -0
  245. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/ScheduleRISCVLevels.cpp +455 -0
  246. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/SeparateRISCVFullTiles.cpp +133 -0
  247. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/SimplifyRISCVControl.cpp +271 -0
  248. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/UnrollRISCVLevels.cpp +380 -0
  249. weft_core-0.2.0/lib/Target/RISCV/Transforms/Control/VectorizeRISCVRecordLoops.cpp +792 -0
  250. weft_core-0.2.0/lib/Target/RISCV/Transforms/Layout/CanonicalizeRISCVLayouts.cpp +1063 -0
  251. weft_core-0.2.0/lib/Target/RISCV/Transforms/Layout/ConsumerLayouts.cpp +737 -0
  252. weft_core-0.2.0/lib/Target/RISCV/Transforms/Layout/EliminateDeadRISCVLayouts.cpp +188 -0
  253. weft_core-0.2.0/lib/Target/RISCV/Transforms/Layout/PropagateRISCVLayouts.cpp +4140 -0
  254. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/FieldReads.h +15 -0
  255. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/FieldStores.h +12 -0
  256. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/ForwardLocalCopies.cpp +554 -0
  257. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/MaterializeRISCVAtomics.cpp +96 -0
  258. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/MaterializeRISCVEncodedValues.cpp +369 -0
  259. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/MaterializeRISCVLocalWindows.cpp +289 -0
  260. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/MaterializeRISCVReadSnapshots.cpp +291 -0
  261. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/PlanRISCVFieldReads.cpp +485 -0
  262. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/PlanRISCVFieldStores.cpp +383 -0
  263. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/PlanRISCVMemory.cpp +6015 -0
  264. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/PointerMemory.cpp +267 -0
  265. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/PointerMemory.h +7 -0
  266. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/SelectRISCVDenseTransfers.cpp +473 -0
  267. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/ShareRISCVLayeredWindows.cpp +3300 -0
  268. weft_core-0.2.0/lib/Target/RISCV/Transforms/Memory/SpecializeRISCVMemory.cpp +401 -0
  269. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/DenseValuePrograms.cpp +1114 -0
  270. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/DenseValuePrograms.h +15 -0
  271. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/LowerRISCVComposites.cpp +2486 -0
  272. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/MaterializeRISCVDenseFragmentLoads.cpp +171 -0
  273. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/MaterializeRISCVPrograms.cpp +158 -0
  274. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/MaterializeRISCVValuePrograms.cpp +1294 -0
  275. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/NumericalValidity.cpp +917 -0
  276. weft_core-0.2.0/lib/Target/RISCV/Transforms/Representation/NumericalValidity.h +22 -0
  277. weft_core-0.2.0/lib/Target/RISCV/Transforms/Resources/AlignRISCVLocalStorage.cpp +132 -0
  278. weft_core-0.2.0/lib/Target/RISCV/Transforms/Resources/MaterializeRISCVResources.cpp +1244 -0
  279. weft_core-0.2.0/lib/Target/RISCV/Transforms/Resources/PlanRISCVResidency.cpp +890 -0
  280. weft_core-0.2.0/lib/Target/RISCV/Transforms/Resources/RISCVResidencyPlanning.h +20 -0
  281. weft_core-0.2.0/lib/Target/RISCV/Transforms/Support/RISCVPhysicalSupport.cpp +2405 -0
  282. weft_core-0.2.0/lib/Target/RISCV/Transforms/Support/RISCVPhysicalSupport.h +222 -0
  283. weft_core-0.2.0/lib/Target/RISCV/Verification/VerifyFinalRISCV.cpp +1273 -0
  284. weft_core-0.2.0/lib/Target/X86/Analysis/Resources.cpp +298 -0
  285. weft_core-0.2.0/lib/Target/X86/Analysis/Resources.h +58 -0
  286. weft_core-0.2.0/lib/Target/X86/Analysis/StorageAnalysis.cpp +93 -0
  287. weft_core-0.2.0/lib/Target/X86/Analysis/StorageAnalysis.h +17 -0
  288. weft_core-0.2.0/lib/Target/X86/Backend/Compiler.cpp +226 -0
  289. weft_core-0.2.0/lib/Target/X86/CMakeLists.txt +43 -0
  290. weft_core-0.2.0/lib/Target/X86/Conversion/ConvertWeftToX86.cpp +6249 -0
  291. weft_core-0.2.0/lib/Target/X86/Conversion/Passes.h +8 -0
  292. weft_core-0.2.0/lib/Target/X86/Emission/LLVMIR.cpp +85 -0
  293. weft_core-0.2.0/lib/Target/X86/IR/Dialects.cpp +72 -0
  294. weft_core-0.2.0/lib/Target/X86/Platform/OneDNN.cpp +295 -0
  295. weft_core-0.2.0/lib/Target/X86/Platform/Target.cpp +217 -0
  296. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/IntegerReductions.cpp +948 -0
  297. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/IntegerReductions.h +39 -0
  298. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/Lookups.cpp +370 -0
  299. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/Lookups.h +14 -0
  300. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/LowPrecision.cpp +186 -0
  301. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/Math.cpp +414 -0
  302. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/Math.h +13 -0
  303. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/UniformValidity.cpp +330 -0
  304. weft_core-0.2.0/lib/Target/X86/Transforms/Arithmetic/VectorProjections.cpp +1120 -0
  305. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/AMXContractions.cpp +512 -0
  306. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/AMXContractions.h +50 -0
  307. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/AMXTransfers.cpp +943 -0
  308. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/ContractionEngines.cpp +293 -0
  309. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/ContractionEngines.h +66 -0
  310. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/ContractionOutputs.cpp +204 -0
  311. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/ContractionOutputs.h +17 -0
  312. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/ContractionSchedules.cpp +303 -0
  313. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/DenseOuterProduct.cpp +411 -0
  314. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/DenseOuterProduct.h +13 -0
  315. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/OneDNNContractions.cpp +1177 -0
  316. weft_core-0.2.0/lib/Target/X86/Transforms/Contraction/OneDNNContractions.h +47 -0
  317. weft_core-0.2.0/lib/Target/X86/Transforms/Control/DeferredIntegerReductions.cpp +173 -0
  318. weft_core-0.2.0/lib/Target/X86/Transforms/Control/FullTiles.cpp +38 -0
  319. weft_core-0.2.0/lib/Target/X86/Transforms/Control/Pipeline.cpp +500 -0
  320. weft_core-0.2.0/lib/Target/X86/Transforms/Control/ProjectionLoops.cpp +110 -0
  321. weft_core-0.2.0/lib/Target/X86/Transforms/Control/ReductionSchedules.cpp +528 -0
  322. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/ArrayForwarding.cpp +240 -0
  323. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/ArrayPackets.cpp +355 -0
  324. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/ArrayPackets.h +19 -0
  325. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/Arrays.h +99 -0
  326. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/IndexedLoopState.cpp +146 -0
  327. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/IndexedValues.cpp +471 -0
  328. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/IndexedValues.h +11 -0
  329. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/RowSnapshots.cpp +124 -0
  330. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/RowSnapshots.h +21 -0
  331. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/SnapshotLoads.cpp +228 -0
  332. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/StreamPrefetch.cpp +214 -0
  333. weft_core-0.2.0/lib/Target/X86/Transforms/Memory/StreamingStores.cpp +122 -0
  334. weft_core-0.2.0/lib/Target/X86/Transforms/Resources/LocalStorage.cpp +405 -0
  335. weft_core-0.2.0/lib/Transforms/CMakeLists.txt +3 -0
  336. weft_core-0.2.0/lib/Transforms/FullTiles.cpp +506 -0
  337. weft_core-0.2.0/lib/Transforms/LoopPipeline.cpp +407 -0
  338. weft_core-0.2.0/licenses/LLVM.txt +278 -0
  339. weft_core-0.2.0/licenses/SLEEF.txt +23 -0
  340. weft_core-0.2.0/pyproject.toml +22 -0
  341. weft_core-0.2.0/python/CMakeLists.txt +9 -0
  342. weft_core-0.2.0/python/runtime.cc +448 -0
  343. weft_core-0.2.0/python/weft_core/__init__.py +22 -0
  344. weft_core-0.2.0/python/weft_core/abi.py +191 -0
  345. weft_core-0.2.0/python/weft_core/artifact.py +132 -0
  346. weft_core-0.2.0/python/weft_core/binding.py +79 -0
  347. weft_core-0.2.0/python/weft_core/buffer.py +344 -0
  348. weft_core-0.2.0/python/weft_core/compile_ir.py +138 -0
  349. weft_core-0.2.0/python/weft_core/compiler.py +216 -0
  350. weft_core-0.2.0/python/weft_core/cpu.py +185 -0
  351. weft_core-0.2.0/python/weft_core/cpu_cli.py +68 -0
  352. weft_core-0.2.0/python/weft_core/diagnostics.py +33 -0
  353. weft_core-0.2.0/python/weft_core/dispatch.py +41 -0
  354. weft_core-0.2.0/python/weft_core/dtypes.py +62 -0
  355. weft_core-0.2.0/python/weft_core/effects.py +89 -0
  356. weft_core-0.2.0/python/weft_core/encoding.py +114 -0
  357. weft_core-0.2.0/python/weft_core/errors.py +3 -0
  358. weft_core-0.2.0/python/weft_core/formats/__init__.py +1 -0
  359. weft_core-0.2.0/python/weft_core/formats/ggml.py +71 -0
  360. weft_core-0.2.0/python/weft_core/integrations/__init__.py +1 -0
  361. weft_core-0.2.0/python/weft_core/integrations/llama_cpp.py +518 -0
  362. weft_core-0.2.0/python/weft_core/ir.py +203 -0
  363. weft_core-0.2.0/python/weft_core/launcher.py +550 -0
  364. weft_core-0.2.0/python/weft_core/native.py +101 -0
  365. weft_core-0.2.0/python/weft_core/options.py +48 -0
  366. weft_core-0.2.0/python/weft_core/package.py +78 -0
  367. weft_core-0.2.0/python/weft_core/schema.py +135 -0
  368. weft_core-0.2.0/python/weft_core/signature.py +329 -0
  369. weft_core-0.2.0/python/weft_core/target.py +39 -0
  370. weft_core-0.2.0/python/weft_core/toolchain.py +228 -0
  371. weft_core-0.2.0/python/weft_core/tuning_state.py +152 -0
  372. weft_core-0.2.0/python/weft_core/types.py +155 -0
  373. weft_core-0.2.0/requirements-docs.txt +3 -0
  374. weft_core-0.2.0/runtime/include/weft/compiler.h +88 -0
  375. weft_core-0.2.0/runtime/include/weft/runtime.h +294 -0
  376. weft_core-0.2.0/runtime/include/weft/runtime.hpp +353 -0
@@ -0,0 +1,10 @@
1
+ /AGENTS.md export-ignore
2
+ /report export-ignore
3
+ /source/c export-ignore
4
+ /examples/run/ggml.sh export-ignore
5
+ /examples/run/ggml-kernel.sh export-ignore
6
+ /.agents export-ignore
7
+ /.codex export-ignore
8
+ /.claude export-ignore
9
+ /.codegraph export-ignore
10
+ /tasks export-ignore
@@ -0,0 +1,33 @@
1
+ # Python and editor-local state
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ *.egg-info/
8
+ /.claude/settings.local.json
9
+ /.claude/worktrees/
10
+
11
+ # Rebuildable outputs
12
+ /build/
13
+ /build-*/
14
+ /build-demo/
15
+ /cmake-build-*/
16
+ /dist/
17
+ /site/
18
+ /.codegraph/
19
+ *.log
20
+
21
+ # Local parallel worktrees
22
+ /.worktrees/
23
+
24
+ # Local development records and reference corpora
25
+ /AGENTS.md
26
+ /report/
27
+ /tasks/
28
+ /.agents/
29
+ /.codex/
30
+ /.claude/
31
+ /source/c/
32
+ /examples/run/ggml.sh
33
+ /examples/run/ggml-kernel.sh
@@ -0,0 +1,138 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3
+ project(WeftCore LANGUAGES C CXX)
4
+ set(WEFT_CORE_SDK "" CACHE PATH "Use an already built native Weft SDK for this host")
5
+ if(WEFT_CORE_SDK)
6
+ foreach(component lib/libweft_compiler.so lib/libweft_runtime.so include/weft/compiler.h include/weft/runtime.h)
7
+ if(NOT EXISTS "${WEFT_CORE_SDK}/${component}")
8
+ message(FATAL_ERROR "WEFT_CORE_SDK is missing ${component}")
9
+ endif()
10
+ endforeach()
11
+ if(CMAKE_CROSSCOMPILING)
12
+ message(FATAL_ERROR "WEFT_CORE_SDK packages an SDK already built for the native host")
13
+ endif()
14
+ include(CheckCSourceRuns)
15
+ set(CMAKE_REQUIRED_LIBRARIES "${WEFT_CORE_SDK}/lib/libweft_compiler.so")
16
+ check_c_source_runs("extern unsigned weft_compiler_abi(void); int main(void) { return weft_compiler_abi() != 1; }"
17
+ WEFT_CORE_SDK_EXECUTABLE)
18
+ unset(CMAKE_REQUIRED_LIBRARIES)
19
+ if(NOT WEFT_CORE_SDK_EXECUTABLE)
20
+ message(FATAL_ERROR "WEFT_CORE_SDK must execute on this host with compiler ABI 1")
21
+ endif()
22
+ set(WEFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
23
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
24
+ set(CMAKE_CXX_STANDARD 20)
25
+ if(NOT DEFINED WEFT_INSTALL_ROOT)
26
+ set(WEFT_INSTALL_ROOT weft_core)
27
+ endif()
28
+ install(DIRECTORY "${WEFT_CORE_SDK}/" DESTINATION ${WEFT_INSTALL_ROOT} USE_SOURCE_PERMISSIONS
29
+ PATTERN "__pycache__" EXCLUDE PATTERN "_runtime*.so" EXCLUDE)
30
+ if(EXISTS "${WEFT_CORE_SDK}/bin/clang")
31
+ install(PROGRAMS "${WEFT_CORE_SDK}/bin/clang"
32
+ DESTINATION ${WEFT_INSTALL_ROOT}/bin)
33
+ endif()
34
+ add_subdirectory(python)
35
+ return()
36
+ endif()
37
+ find_package(LLVM REQUIRED CONFIG)
38
+ find_package(MLIR REQUIRED CONFIG)
39
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}" "${MLIR_CMAKE_DIR}")
40
+ include(TableGen)
41
+ include(AddLLVM)
42
+ include(AddMLIR)
43
+ include_directories(SYSTEM ${LLVM_INCLUDE_DIRS} ${MLIR_INCLUDE_DIRS})
44
+ if(LLVM_ENABLE_ASSERTIONS)
45
+ add_compile_options(-UNDEBUG)
46
+ endif()
47
+ set(WEFT_STANDALONE ON)
48
+ endif()
49
+
50
+ # The embedding compiler and standalone SDK select the same LLVM/MLIR build.
51
+ set(WEFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
52
+ set(WEFT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
53
+ if(NOT DEFINED WEFT_INSTALL_ROOT)
54
+ if(WEFT_STANDALONE)
55
+ set(WEFT_INSTALL_ROOT .)
56
+ else()
57
+ set(WEFT_INSTALL_ROOT triton_weft/_C/weft)
58
+ endif()
59
+ endif()
60
+ if(WEFT_STANDALONE)
61
+ file(READ "${WEFT_SOURCE_DIR}/pyproject.toml" WEFT_VERSION_SOURCE)
62
+ string(REGEX MATCH "\nversion = \"([^\"]+)\"" WEFT_VERSION_MATCH "${WEFT_VERSION_SOURCE}")
63
+ else()
64
+ file(READ "${PROJECT_SOURCE_DIR}/python/triton_weft/_weft_version.py" WEFT_VERSION_SOURCE)
65
+ string(REGEX MATCH "__version__ = \"([^\"]+)\"" WEFT_VERSION_MATCH "${WEFT_VERSION_SOURCE}")
66
+ endif()
67
+ if(NOT WEFT_VERSION_MATCH)
68
+ message(FATAL_ERROR "The Weft package must declare its release version")
69
+ endif()
70
+ set(WEFT_RELEASE_VERSION "${CMAKE_MATCH_1}")
71
+ set(WEFT_ONEDNN_ROOT "$ENV{WEFT_ONEDNN_ROOT}" CACHE PATH "Optional oneDNN installation root with experimental BRGeMM ukernel support")
72
+ set(WEFT_ONEDNN_HEADER_AVAILABLE 0)
73
+ set(WEFT_ONEDNN_LIBRARY_PATH "")
74
+ if(WEFT_ONEDNN_ROOT AND EXISTS "${WEFT_ONEDNN_ROOT}/include/oneapi/dnnl/dnnl_ukernel.h")
75
+ set(WEFT_ONEDNN_HEADER_AVAILABLE 1)
76
+ if(EXISTS "${WEFT_ONEDNN_ROOT}/lib/libdnnl.so.3")
77
+ set(WEFT_ONEDNN_LIBRARY_PATH "${WEFT_ONEDNN_ROOT}/lib/libdnnl.so.3")
78
+ elseif(EXISTS "${WEFT_ONEDNN_ROOT}/lib/libdnnl.so")
79
+ set(WEFT_ONEDNN_LIBRARY_PATH "${WEFT_ONEDNN_ROOT}/lib/libdnnl.so")
80
+ endif()
81
+ endif()
82
+ include(CMakePackageConfigHelpers)
83
+ write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/WeftConfigVersion.cmake"
84
+ VERSION "${WEFT_RELEASE_VERSION}" COMPATIBILITY SameMajorVersion)
85
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
86
+ set(CMAKE_CXX_STANDARD 20)
87
+ if(NOT LLVM_ENABLE_RTTI)
88
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>)
89
+ endif()
90
+ include_directories(${WEFT_SOURCE_DIR}/include ${WEFT_BINARY_DIR}/include
91
+ ${WEFT_SOURCE_DIR}/runtime/include)
92
+ option(WEFT_CANONICAL_ONLY "Build the Canonical IR dialect for an embedding MLIR compiler" OFF)
93
+ if(WEFT_CANONICAL_ONLY)
94
+ add_subdirectory(include/Weft/Dialect/Kernel/IR)
95
+ add_subdirectory(lib/Dialect/Kernel/IR)
96
+ return()
97
+ endif()
98
+ if(NOT TRITON_WEFT_RUNTIME_ONLY)
99
+ add_subdirectory(include)
100
+ endif()
101
+ add_subdirectory(lib)
102
+ if(NOT TRITON_WEFT_RUNTIME_ONLY)
103
+ add_subdirectory(lib/Compiler)
104
+ endif()
105
+ option(WEFT_BUILD_PYTHON "Build the shared Python native-launch binding" ${WEFT_STANDALONE})
106
+ if(WEFT_BUILD_PYTHON)
107
+ add_subdirectory(python)
108
+ endif()
109
+ if(NOT TRITON_WEFT_RUNTIME_ONLY)
110
+ target_include_directories(WeftRISCVTarget PUBLIC
111
+ ${WEFT_SOURCE_DIR}/include ${WEFT_BINARY_DIR}/include)
112
+ endif()
113
+ install(TARGETS WeftRuntime LIBRARY DESTINATION ${WEFT_INSTALL_ROOT}/lib)
114
+ install(FILES runtime/include/weft/runtime.h runtime/include/weft/runtime.hpp
115
+ DESTINATION ${WEFT_INSTALL_ROOT}/include/weft)
116
+ install(DIRECTORY integrations/llama.cpp/ DESTINATION ${WEFT_INSTALL_ROOT}/share/llama.cpp)
117
+ install(FILES cmake/WeftConfig.cmake DESTINATION ${WEFT_INSTALL_ROOT}/lib/cmake/Weft)
118
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/WeftConfigVersion.cmake"
119
+ DESTINATION ${WEFT_INSTALL_ROOT}/lib/cmake/Weft)
120
+ install(FILES LICENSE NOTICE THIRD_PARTY_NOTICES.md
121
+ DESTINATION ${WEFT_INSTALL_ROOT}/licenses)
122
+ install(FILES lib/Runtime/ggml-threadpool-LICENSE
123
+ DESTINATION ${WEFT_INSTALL_ROOT}/licenses)
124
+ install(DIRECTORY licenses/ DESTINATION ${WEFT_INSTALL_ROOT}/licenses)
125
+
126
+ if(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
127
+ set(WEFT_WHEEL_ROOT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/weft")
128
+ set_target_properties(WeftRuntime PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${WEFT_WHEEL_ROOT}/lib")
129
+ file(COPY runtime/include/weft DESTINATION "${WEFT_WHEEL_ROOT}/include")
130
+ file(COPY LICENSE NOTICE THIRD_PARTY_NOTICES.md DESTINATION "${WEFT_WHEEL_ROOT}/licenses")
131
+ file(COPY lib/Runtime/ggml-threadpool-LICENSE DESTINATION "${WEFT_WHEEL_ROOT}/licenses")
132
+ file(COPY licenses/ DESTINATION "${WEFT_WHEEL_ROOT}/licenses")
133
+ file(COPY integrations/llama.cpp DESTINATION "${WEFT_WHEEL_ROOT}/share")
134
+ file(COPY cmake/WeftConfig.cmake DESTINATION "${WEFT_WHEEL_ROOT}/lib/cmake/Weft")
135
+ file(COPY "${CMAKE_CURRENT_BINARY_DIR}/WeftConfigVersion.cmake"
136
+ DESTINATION "${WEFT_WHEEL_ROOT}/lib/cmake/Weft")
137
+ endif()
138
+ include(cmake/NativeToolchain.cmake)
@@ -0,0 +1,33 @@
1
+ # Contributing to the Weft model
2
+
3
+ Start with the [handbook](doc/index.md) and [installation guide](doc/getting-started/installation.md).
4
+ Changes to this component build through the enclosing Triton source tree.
5
+
6
+ | Responsibility | Location relative to the repository root |
7
+ |---|---|
8
+ | Shared Python AST entry | python/triton/compiler/code_generator.py |
9
+ | Weft language and semantic lowering | python/triton/language/weft, python/triton/compiler/weft |
10
+ | Canonical and RISC-V physical IR | third_party/weft/include/Weft, third_party/weft/lib/Dialect |
11
+ | Physical passes and terminal emission | third_party/weft/lib/Target |
12
+ | JIT and autotuning | python/triton/runtime/jit.py, autotuner.py |
13
+ | CPU backend and C toolchain stage | python/triton/backends/weft |
14
+ | Native ABI/runtime and SDK | third_party/weft/lib/Runtime, include/weft |
15
+ | Framework model hooks | python/triton/experimental/torch |
16
+ | Author programs | third_party/weft/source |
17
+
18
+ Preserve author numerical, Encoding, Level, lifetime and effect contracts.
19
+ Target passes make physical decisions from typed dataflow and target facts;
20
+ terminal emission spells the decisions already written into IR.
21
+ Hardware extensions use capability facts and local operations, not kernel-name routing.
22
+
23
+ Build and install the unified Triton wheel. Inspect Canonical/Physical IR and C through
24
+ CompiledKernel.asm. Use the independent Weft Bench plugin for affected numerical/performance
25
+ cases and existing input/oracle/runner definitions. Keep its output and fixed baselines outside
26
+ this source tree. State separately whether a change generated code, compiled, ran correctly,
27
+ or improved performance. Do not relax tolerances or replace an actual integration check with
28
+ the presence of a decorator or generated artifact.
29
+
30
+ Pull requests should explain the concrete behavior change and relevant execution evidence.
31
+ Run git diff --check; do not include local credentials, build products, caches, historical
32
+ reports or an additional test runner. The build workflow checks wheel installation and
33
+ handbook links; target execution belongs to the external Bench environment.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
weft_core-0.2.0/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ Weft
2
+ Copyright 2026 Weft contributors
3
+
4
+ Weft is distributed under the Apache License, Version 2.0.
5
+ Third-party components retain their respective copyrights and licenses.
6
+ See THIRD_PARTY_NOTICES.md and licenses/ for bundled notices.