diff --git a/zml/kernels/paged_attention/triton/triton.zig b/zml/kernels/paged_attention/triton/triton.zig index 2a12e012..a0379d29 100644 --- a/zml/kernels/paged_attention/triton/triton.zig +++ b/zml/kernels/paged_attention/triton/triton.zig @@ -87,6 +87,10 @@ fn select2dConfig(options: paged.PagedAttentionOptions) Config2D { } num_stages_2d = 1; num_warps = 4; + if (isOneapiTarget() and options.head_dim >= 256) { + tile_size = 64; + num_warps = 32; + } } block_q = block_m / options.numQueriesPerKv(); const total_q_blocks = options.num_tokens / block_q + options.batch_size; diff --git a/zml/tensor.zig b/zml/tensor.zig index ee084835..a09a5d38 100644 --- a/zml/tensor.zig +++ b/zml/tensor.zig @@ -282,13 +282,7 @@ pub const Tensor = struct { pub fn toMemory(self: Tensor, kind: Memory.Kind) Tensor { const ctx = Compiler.current(); switch (ctx.platform.target) { - .cpu, .neuron, .metal => { - // A single memory needs no copy, but the result must still be a distinct - // tensor: `reuseBuffer` donations are keyed by tensor id. - var res = _result(self._shape, self.value()); - res._shape._sharding = self._shape._sharding; - return res; - }, + .cpu, .neuron, .metal => return self, .cuda, .rocm, .tpu, .oneapi, .furiosa => {}, }