helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Fix custom generate relative imports

Same as #38916, but for repos on the hub. This time we dont need to copy anything, as the whole repo is cloned, we just need to handle the paths properly.

This gets tested indirectly with the custom generate tests that will come with group beam search etc.



Changed files:
filename: src/transformers/dynamic_module_utils.py
patch: @@ -428,10 +428,10 @@ def get_cached_module_file(
             importlib.invalidate_caches()
         # Make sure we also have every file with relative
         for module_needed in modules_needed:
-            if not (submodule_path / f"{module_needed}.py").exists():
+            if not ((submodule_path / module_file).parent / f"{module_needed}.py").exists():
                 get_cached_module_file(
                     pretrained_model_name_or_path,
-                    f"{module_needed}.py",
+                    f"{Path(module_file).parent / module_needed}.py",
                     cache_dir=cache_dir,
                     force_download=force_download,
                     resume_download=resume_download,
Repository: denoland/deno
Pull request: fix(napi): Fix misused `napi_callback_info` in `CallbackInfo`

According to https://nodejs.org/api/n-api.html#napi_create_function, the `data` parameter is user-provided data context, which will be passed back into the function when invoked later. But here deno types it as `napi_callback_info`, which seems like a pointer to `CallbackInfo`. This misuse confuses me a lot when I'm reading the code.

References:
- https://github.com/nodejs/node/blob/59b70e5fe397db2457e10469985cb47fd7af0687/src/js_native_api_v8.cc#L939

Changed files:
filename: ext/napi/function.rs
patch: @@ -6,7 +6,7 @@ use crate::*;
 pub struct CallbackInfo {
   pub env: *mut Env,
   pub cb: napi_callback,
-  pub cb_info: napi_callback_info,
+  pub data: *mut c_void,
   pub args: *const c_void,
 }
 
@@ -15,12 +15,12 @@ impl CallbackInfo {
   pub fn new_raw(
     env: *mut Env,
     cb: napi_callback,
-    cb_info: napi_callback_info,
+    data: *mut c_void,
   ) -> *mut Self {
     Box::into_raw(Box::new(Self {
       env,
       cb,
-      cb_info,
+      data,
       args: std::ptr::null(),
     }))
   }
@@ -58,10 +58,10 @@ pub fn create_function<'s>(
   env: *mut Env,
   name: Option<v8::Local<v8::String>>,
   cb: napi_callback,
-  cb_info: napi_callback_info,
+  data: *mut c_void,
 ) -> v8::Local<'s, v8::Function> {
   let external =
-    v8::External::new(scope, CallbackInfo::new_raw(env, cb, cb_info) as *mut _);
+    v8::External::new(scope, CallbackInfo::new_raw(env, cb, data) as *mut _);
   let function = v8::Function::builder_raw(call_fn)
     .data(external.into())
     .build(scope)

filename: ext/napi/js_native_api.rs
patch: @@ -188,7 +188,7 @@ fn napi_create_function<'s>(
   name: *const c_char,
   length: usize,
   cb: Option<napi_callback>,
-  cb_info: napi_callback_info,
+  data: *mut c_void,
   result: *mut napi_value<'s>,
 ) -> napi_status {
   let env_ptr = env as *mut Env;
@@ -206,8 +206,7 @@ fn napi_create_function<'s>(
 
   unsafe {
     v8::callback_scope!(unsafe scope, env.context());
-    *result =
-      create_function(scope, env_ptr, name, cb.unwrap(), cb_info).into();
+    *result = create_function(scope, env_ptr, name, cb.unwrap(), data).into();
   }
 
   napi_ok
@@ -1674,7 +1673,7 @@ fn napi_get_cb_info(
 
   if !data.is_null() {
     unsafe {
-      *data = cbinfo.cb_info;
+      *data = cbinfo.data;
     }
   }
Repository: facebook/react
Pull request: Add descriptions of new methods to the react-reconciler readme

Add new reconciler methods since last breaking change to the README based on usage and comments.

Changed files:
filename: packages/react-reconciler/README.md
patch: @@ -318,6 +318,30 @@ Same as `unhideInstance`, but for nodes created by `createTextInstance`.
 
 This method should mutate the `container` root node and remove all children from it.
 
+#### `maySuspendCommit(type, props)`
+
+This method is called during render to determine if the Host Component type and props require some kind of loading process to complete before committing an update.
+
+#### `preloadInstance(type, props)`
+
+This method may be called during render if the Host Component type and props might suspend a commit. It can be used to initiate any work that might shorten the duration of a suspended commit.
+
+#### `startSuspendingCommit()`
+
+This method is called just before the commit phase. Use it to set up any necessary state while any Host Components that might suspend this commit are evaluated to determine if the commit must be suspended.
+
+#### `suspendInstance(type, props)`
+
+This method is called after `startSuspendingCommit` for each Host Component that indicated it might suspend a commit.
+
+#### `waitForCommitToBeReady()`
+
+This method is called after all `suspendInstance` calls are complete.
+
+Return `null` if the commit can happen immediately.
+
+Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this callback will initiate the commit when called. The return value is a cancellation function that the Reconciler can use to abort the commit.
+
 ### Persistence Methods
 
 If you use the persistent mode instead of the mutation mode, you would still need the "Core Methods". However, instead of the Mutation Methods above you will implement a different set of methods that performs cloning nodes and replacing them at the root level. You can find a list of them in the "Persistence" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberConfig.custom.js). File an issue if you need help.
Repository: nodejs/node
Pull request: v8: fix missing callback in heap utils destroy

This fixes the v8.getHeapSnapshot() calls not properly being destroyed. Pipeline calls would for example not properly end without the callback being in place.

Thanks to @ronag to look into this!

Changed files:
filename: lib/internal/heap_utils.js
patch: @@ -53,11 +53,12 @@ class HeapSnapshotStream extends Readable {
       this[kHandle].readStart();
   }
 
-  _destroy() {
+  _destroy(err, callback) {
     // Release the references on the handle so that
     // it can be garbage collected.
     this[kHandle][owner_symbol] = undefined;
     this[kHandle] = undefined;
+    callback(err);
   }
 
   [kUpdateTimer]() {

filename: test/sequential/test-heapdump.js
patch: @@ -10,6 +10,7 @@ if (!isMainThread) {
 const { writeHeapSnapshot, getHeapSnapshot } = require('v8');
 const assert = require('assert');
 const fs = require('fs');
+const { promises: { pipeline }, PassThrough } = require('stream');
 const tmpdir = require('../common/tmpdir');
 
 tmpdir.refresh();
@@ -78,3 +79,13 @@ process.chdir(tmpdir.path);
     JSON.parse(data);
   }));
 }
+
+{
+  const passthrough = new PassThrough();
+  passthrough.on('data', common.mustCallAtLeast(1));
+
+  pipeline(
+    getHeapSnapshot(),
+    passthrough,
+  ).then(common.mustCall());
+}
Repository: ollama/ollama
Pull request: return failure details when unauthorized to push

Previous behavior:
Pushing to the default namespace or a namespace you don't have access to results in a vague error.
```
$ ollama push mario
retrieving manifest
Error: max retries exceeded
```

New behavior:
Pushing to the default namespace or a namespace you don't have access to results the reason for the error.
```
$ ollama push mario
retrieving manifest
Error: unable to push library/mario, make sure this namespace exists and you are authorized to push to it

$ ollama push bruxe/mario
retrieving manifest
Error: unable to push bruxe/mario, make sure this namespace exists and you are authorized to push to it
```

Resolves #1140 

Changed files:
filename: server/images.go
patch: @@ -954,6 +954,9 @@ func PushModel(ctx context.Context, name string, regOpts *RegistryOptions, fn fu
 	for _, layer := range layers {
 		if err := uploadBlob(ctx, mp, layer, regOpts, fn); err != nil {
 			log.Printf("error uploading blob: %v", err)
+			if errors.Is(err, errUnauthorized) {
+				return fmt.Errorf("unable to push %s, make sure this namespace exists and you are authorized to push to it", ParseModelPath(name).GetNamespaceRepository())
+			}
 			return err
 		}
 	}
@@ -1140,7 +1143,10 @@ func GetSHA256Digest(r io.Reader) (string, int64) {
 	return fmt.Sprintf("sha256:%x", h.Sum(nil)), n
 }
 
+var errUnauthorized = fmt.Errorf("unauthorized")
+
 func makeRequestWithRetry(ctx context.Context, method string, requestURL *url.URL, headers http.Header, body io.ReadSeeker, regOpts *RegistryOptions) (*http.Response, error) {
+	lastErr := errMaxRetriesExceeded
 	for try := 0; try < maxRetries; try++ {
 		resp, err := makeRequest(ctx, method, requestURL, headers, body, regOpts)
 		if err != nil {
@@ -1161,8 +1167,7 @@ func makeRequestWithRetry(ctx context.Context, method string, requestURL *url.UR
 			if body != nil {
 				body.Seek(0, io.SeekStart)
 			}
-
-			continue
+			lastErr = errUnauthorized
 		case resp.StatusCode == http.StatusNotFound:
 			return nil, os.ErrNotExist
 		case resp.StatusCode >= http.StatusBadRequest:
@@ -1177,7 +1182,7 @@ func makeRequestWithRetry(ctx context.Context, method string, requestURL *url.UR
 		}
 	}
 
-	return nil, errMaxRetriesExceeded
+	return nil, lastErr
 }
 
 func makeRequest(ctx context.Context, method string, requestURL *url.URL, headers http.Header, body io.Reader, regOpts *RegistryOptions) (*http.Response, error) {
Repository: ollama/ollama
Pull request: fix push for model inheriting from other models

- fix auth scope: side effect of #1055 which changed the value of the scope parameter in the auth challenge
- fix cross repo mounts

resolves #1154 

Changed files:
filename: server/upload.go
patch: @@ -77,6 +77,14 @@ func (b *blobUpload) Prepare(ctx context.Context, requestURL *url.URL, opts *Reg
 
 	b.Total = fi.Size()
 
+	// http.StatusCreated indicates a blob has been mounted
+	// ref: https://distribution.github.io/distribution/spec/api/#cross-repository-blob-mount
+	if resp.StatusCode == http.StatusCreated {
+		b.Completed.Store(b.Total)
+		b.done = true
+		return nil
+	}
+
 	var size = b.Total / numUploadParts
 	switch {
 	case size < minUploadPartSize:
Repository: vercel/next.js
Pull request: Turbopack: hide blocking spans in trace server

### What?

We annotate `block_in_place` with a `blocking` span to allow hiding the blocking time in the trace.

Closes PACK-5378

Changed files:
filename: turbopack/crates/turbopack-trace-server/src/span.rs
patch: @@ -79,7 +79,7 @@ impl Span {
         self.time_data.get_or_init(|| {
             Box::new(SpanTimeData {
                 self_end: self.start,
-                ignore_self_time: &self.name == "thread",
+                ignore_self_time: &self.name == "thread" || &self.name == "blocking",
                 ..Default::default()
             })
         })
Repository: denoland/deno
Pull request: Revert "ci: skip running WPT and node compat unless labels present (#…

…31012)"

This reverts commit f54a5466e260ccb6fb1c4e49246b651ac372cf76.

This doesn't work, immediately after landing this, `main` branch got broken
with a faulty PR.

Changed files:
filename: .github/workflows/ci.generate.ts
patch: @@ -419,8 +419,7 @@ const ci = {
             use_sysroot: true,
             // TODO(ry): Because CI is so slow on for OSX and Windows, we
             // currently run the Web Platform tests only on Linux.
-            wpt:
-              "${{ !startsWith(github.ref, 'refs/tags/') && (github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'ci-wpt-test')) }}",
+            wpt: "${{ !startsWith(github.ref, 'refs/tags/') }}",
           }, {
             ...Runners.linuxX86Xl,
             job: "bench",
@@ -470,8 +469,6 @@ const ci = {
         RUST_BACKTRACE: "full",
         // disable anyhow's library backtrace
         RUST_LIB_BACKTRACE: 0,
-        CI_SKIP_NODE_TEST:
-          "${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-node-test') }}",
       },
       steps: skipJobsIfPrAndMarkedSkip([
         ...cloneRepoStep,

filename: .github/workflows/ci.yml
patch: @@ -97,7 +97,7 @@ jobs:
             job: test
             profile: release
             use_sysroot: true
-            wpt: '${{ !startsWith(github.ref, ''refs/tags/'') && (github.ref == ''refs/heads/main'' || contains(github.event.pull_request.labels.*.name, ''ci-wpt-test'')) }}'
+            wpt: '${{ !startsWith(github.ref, ''refs/tags/'') }}'
           - os: linux
             arch: x86_64
             runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench''))) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && ''ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04'' || ''ubuntu-24.04'' }}'
@@ -143,7 +143,6 @@ jobs:
       CARGO_TERM_COLOR: always
       RUST_BACKTRACE: full
       RUST_LIB_BACKTRACE: 0
-      CI_SKIP_NODE_TEST: '${{ github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-node-test'') }}'
     steps:
       - name: Configure git
         run: |-

filename: tests/node_compat/test_runner.rs
patch: @@ -4,16 +4,7 @@ use test_util as util;
 use util::deno_config_path;
 
 #[test]
-#[allow(clippy::print_stderr)]
 fn node_compat_tests() {
-  // Skip Node.js compatibility tests in CI on PRs unless ci-node-test label is present
-  if std::env::var("CI_SKIP_NODE_TEST").unwrap_or_default() == "true" {
-    eprintln!(
-      "Skipping Node.js compatibility tests (CI_SKIP_NODE_TEST is set)"
-    );
-    return;
-  }
-
   let _server = util::http_server();
 
   let mut deno = util::deno_cmd()
Repository: ollama/ollama
Pull request: New big-AGI integration

Hi @jmorganca, we added Ollama support to big-AGI, which makes it easy to fetch, list models, generate text, chat, compare models, and even voice call, etc.

![image](https://github.com/jmorganca/ollama/assets/32999/66c0c2b8-2eea-4982-bf6c-ba1cd05cd18d)

I've linked the configuration document directly.

Changed files:
filename: README.md
patch: @@ -224,6 +224,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Minimalistic React UI for Ollama Models](https://github.com/richawo/minimal-llm-ui)
 - [Web UI](https://github.com/ollama-webui/ollama-webui)
 - [Ollamac](https://github.com/kevinhermawan/Ollamac)
+- [big-AGI](https://github.com/enricoros/big-agi/blob/main/docs/config-ollama.md)
 
 ### Terminal
Repository: facebook/react
Pull request: Create short link for jsx warning

Short link created in https://github.com/reactjs/react.dev/pull/6772

Changed files:
filename: packages/react/src/jsx/ReactJSXElement.js
patch: @@ -738,9 +738,7 @@ export function createElement(type, config, children) {
         console.warn(
           'Your app (or one of its dependencies) is using an outdated JSX ' +
             'transform. Update to the modern JSX transform for ' +
-            'faster performance: ' +
-            // TODO: Create a short link for this
-            'https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html',
+            'faster performance: https://react.dev/link/new-jsx-transform',
         );
       }
     }
Repository: nodejs/node
Pull request: build: test macos-13 on GitHub actions

We are in the process of updating macOS to version 13 in the
Jenkins CI, but unfortunately this is taking longer than expected.
Add it to the GitHub actions test matrix so that we have some coverage.

Refs: https://github.com/nodejs/build/issues/3686



Changed files:
filename: .github/workflows/test-macos.yml
patch: @@ -38,7 +38,11 @@ permissions:
 jobs:
   test-macOS:
     if: github.event.pull_request.draft == false
-    runs-on: macos-14
+    strategy:
+      fail-fast: false
+      matrix:
+        macos-version: [macos-13, macos-14]
+    runs-on: ${{ matrix.macos-version }}
     env:
       CC: sccache gcc
       CXX: sccache g++
Repository: ollama/ollama
Pull request: install: fix enable contrib on debian 12

On debian 12, sources definitions have moved from
/etc/apt/sources.list to /etc/apt/sources.list.d/debian.sources

Changed files:
filename: scripts/install.sh
patch: @@ -181,6 +181,9 @@ install_cuda_driver_apt() {
         debian)
             status 'Enabling contrib sources...'
             $SUDO sed 's/main/contrib/' < /etc/apt/sources.list | $SUDO tee /etc/apt/sources.list.d/contrib.list > /dev/null
+            if [ -f "/etc/apt/sources.list.d/debian.sources" ]; then
+                $SUDO sed 's/main/contrib/' < /etc/apt/sources.list.d/debian.sources | $SUDO tee /etc/apt/sources.list.d/contrib.sources > /dev/null
+            fi
             ;;
     esac
Repository: ggml-org/llama.cpp
Pull request: s390x: disable vxe for cross-compilation by default

Otherwise compilation will fail due to enabling -mvx -mzvector and not setting corresponding -march options.

For cross-compilation on s390x with vxe option `GGML_CPU_ALL_VARIANTS` has to be enabled too.

Changed files:
filename: ggml/CMakeLists.txt
patch: @@ -168,7 +168,7 @@ option(GGML_RV_ZFH           "ggml: enable riscv zfh"        ON)
 option(GGML_RV_ZVFH          "ggml: enable riscv zvfh"       ON)
 option(GGML_RV_ZICBOP        "ggml: enable riscv zicbop"     ON)
 option(GGML_XTHEADVECTOR     "ggml: enable xtheadvector"     OFF)
-option(GGML_VXE              "ggml: enable vxe"              ON)
+option(GGML_VXE              "ggml: enable vxe"              ${GGML_NATIVE})
 
 option(GGML_CPU_ALL_VARIANTS "ggml: build all variants of the CPU backend (requires GGML_BACKEND_DL)" OFF)
 set(GGML_CPU_ARM_ARCH        "" CACHE STRING "ggml: CPU architecture for ARM")
Repository: denoland/deno
Pull request: fix: reject running `.bat` and `.cmd` directly on windows


Changed files:
filename: ext/process/lib.rs
patch: @@ -752,6 +752,21 @@ fn compute_run_cmd_and_check_permissions(
       command: arg_cmd.to_string(),
       error: Box::new(e),
     })?;
+  #[cfg(windows)]
+  if let Some(ext) = cmd.extension()
+    && (ext == "bat" || ext == "cmd")
+  {
+    return Err(ProcessError::SpawnFailed {
+      command: arg_cmd.to_string(),
+      error: Box::new(
+        std::io::Error::new(
+          std::io::ErrorKind::PermissionDenied,
+          "Use a shell to execute .bat or .cmd files",
+        )
+        .into(),
+      ),
+    });
+  }
   check_run_permission(
     state,
     &RunQueryDescriptor::Path(

filename: tests/unit/command_test.ts
patch: @@ -779,6 +779,28 @@ Deno.test(
   },
 );
 
+Deno.test(
+  {
+    permissions: { run: true, read: true, write: true },
+    ignore: Deno.build.os !== "windows",
+  },
+  async function rejectBatAndCmdFiles() {
+    const tempDir = await Deno.makeTempDir();
+    const fileName = tempDir + "/test.bat";
+    const file = await Deno.open(fileName, {
+      create: true,
+      write: true,
+    });
+
+    await assertRejects(async () => {
+      await new Deno.Command(fileName, {
+        args: ["&calc.exe"],
+      }).output();
+    }, Deno.errors.PermissionDenied);
+    file.close();
+  },
+);
+
 Deno.test(
   {
     permissions: { run: true, read: true },
Repository: huggingface/transformers
Pull request: Allow `remi-or` to `run-slow`

# What does this PR do?

Make AMD happy

Changed files:
filename: .github/workflows/self-comment-ci.yml
patch: @@ -29,7 +29,7 @@ jobs:
     runs-on: ubuntu-22.04
     name: Get PR number
     # For security: only allow team members to run
-    if: ${{ github.event.issue.state == 'open' && contains(fromJSON('["ydshieh", "ArthurZucker", "zucchini-nlp", "qubvel", "molbap", "gante", "LysandreJik", "Cyrilvallez", "Rocketknight1", "SunMarc", "muellerzr", "eustlb", "MekkCyber", "manueldeprada", "vasqu", "ivarflakstad", "stevhliu", "ebezzam"]'), github.actor) && (startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow')) }}
+    if: ${{ github.event.issue.state == 'open' && contains(fromJSON('["ydshieh", "ArthurZucker", "zucchini-nlp", "qubvel", "molbap", "gante", "LysandreJik", "Cyrilvallez", "Rocketknight1", "SunMarc", "muellerzr", "eustlb", "MekkCyber", "manueldeprada", "vasqu", "ivarflakstad", "stevhliu", "ebezzam", "remi-or"]'), github.actor) && (startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow')) }}
     outputs:
       PR_NUMBER: ${{ steps.set_pr_number.outputs.PR_NUMBER }}
     steps:
Repository: ggml-org/llama.cpp
Pull request: vulkan: Fix test-thread-safety crashes

The std::map pipeline_flash_attn_f32_f16 could be searched and inserted at the same time, which needs to hold the lock. To be safe, hold the lock for all of ggml_vk_load_shaders.

See https://github.com/ggml-org/llama.cpp/pull/16826#issuecomment-3491580146

Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -130,9 +130,9 @@ struct vk_pipeline_struct {
     // true if fields have been set by ggml_vk_create_pipeline
     bool initialized {};
     // set to true to request the pipeline is compiled
-    bool needed {};
+    std::atomic<bool> needed {};
     // set to true when the shader has been compiled
-    bool compiled {};
+    std::atomic<bool> compiled {};
     // number of registers used, extracted from pipeline executable properties
     uint32_t register_count {};
 };
@@ -1842,10 +1842,7 @@ static void ggml_vk_create_pipeline_func(vk_device& device, vk_pipeline& pipelin
         }
     }
 
-    {
-        std::lock_guard<std::recursive_mutex> guard(device->mutex);
-        device->all_pipelines.push_back(pipeline);
-    }
+    device->all_pipelines.push_back(pipeline);
 
     {
         std::lock_guard<std::mutex> guard(compile_count_mutex);
@@ -2536,6 +2533,7 @@ static uint32_t get_subgroup_size(const std::string &pipeline_name, const vk_dev
 static void ggml_vk_load_shaders(vk_device& device) {
     VK_LOG_DEBUG("ggml_vk_load_shaders(" << device->name << ")");
 
+    std::lock_guard<std::recursive_mutex> guard(device->mutex);
     // some shaders have a minimum subgroup size
     const uint32_t subgroup_size_8 = std::max(device->subgroup_size, 8u);
     const uint32_t subgroup_size_16 = std::max(device->subgroup_size, 16u);
@@ -2729,6 +2727,8 @@ static void ggml_vk_load_shaders(vk_device& device) {
         if (!pipeline->needed || pipeline->compiled) {
             return;
         }
+        // TODO: We're no longer benefitting from the async compiles (shaders are
+        // compiled individually, as needed) and this complexity can be removed.
         {
             // wait until fewer than N compiles are in progress
             uint32_t N = std::max(1u, std::thread::hardware_concurrency());
@@ -7914,12 +7914,15 @@ static void ggml_vk_flash_attn(ggml_backend_vk_context * ctx, vk_context& subctx
 
     vk_pipeline pipeline = nullptr;
 
-    auto &pipelines = ctx->device->pipeline_flash_attn_f32_f16[k->type];
-    auto it = pipelines.find(fa_pipeline_state);
-    if (it != pipelines.end()) {
-        pipeline = it->second;
-    } else {
-        pipelines[fa_pipeline_state] = pipeline = std::make_shared<vk_pipeline_struct>();
+    {
+        std::lock_guard<std::recursive_mutex> guard(ctx->device->mutex);
+        auto &pipelines = ctx->device->pipeline_flash_attn_f32_f16[k->type];
+        auto it = pipelines.find(fa_pipeline_state);
+        if (it != pipelines.end()) {
+            pipeline = it->second;
+        } else {
+            pipelines[fa_pipeline_state] = pipeline = std::make_shared<vk_pipeline_struct>();
+        }
     }
 
     assert(pipeline);