helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: [Deprecation Warnings]: add amp deprecation warning

We are dropping amp support in an upcoming major. This adds a warning for using these configuration options and updates the docs with the warning. 

Changed files:
filename: docs/02-pages/02-guides/amp.mdx
patch: @@ -11,6 +11,8 @@ description: With minimal config, and without leaving React, you can start addin
 
 </details>
 
+> **Warning**: Built-in amp support will be removed in Next.js 16.
+
 With Next.js you can turn any React page into an AMP page, with minimal config, and without leaving React.
 
 You can read more about AMP in the official [amp.dev](https://amp.dev/) site.

filename: packages/next/src/server/config-shared.ts
patch: @@ -500,6 +500,7 @@ export interface ExperimentalConfig {
   nextScriptWorkers?: boolean
   scrollRestoration?: boolean
   externalDir?: boolean
+  /** @deprecated built-in amp support will be removed in Next 16 */
   amp?: {
     optimizer?: any
     validator?: string
@@ -1146,7 +1147,10 @@ export interface NextConfig extends Record<string, any> {
     pagesBufferLength?: number
   }
 
-  /** @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp) */
+  /**
+   * @deprecated built-in amp support will be removed in Next 16
+   * @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp)
+   */
   amp?: {
     canonicalBase?: string
   }

filename: packages/next/src/server/config.ts
patch: @@ -503,6 +503,26 @@ function assignDefaults(
     }
   }
 
+  // There are a good amount of test fixtures that have amp enabled
+  // that also assert on stderr output being empty, so we're gating the
+  // warning to be skipped when running in Next.js tests until we fully
+  // remove the feature.
+  if (!process.env.__NEXT_TEST_MODE) {
+    warnOptionHasBeenDeprecated(
+      result,
+      'amp',
+      `Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`,
+      silent
+    )
+
+    warnOptionHasBeenDeprecated(
+      result,
+      'experimental.amp',
+      `Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`,
+      silent
+    )
+  }
+
   warnCustomizedOption(
     result,
     'experimental.esmExternals',
Repository: ollama/ollama
Pull request: better error message when model not found on pull

```
ollama run orca-dne
pulling manifest
Error: pull model manifest: model not found
```

resolves #180

Changed files:
filename: api/client.go
patch: @@ -131,7 +131,7 @@ func (c *Client) stream(ctx context.Context, method, path string, data any, fn f
 		}
 
 		if errorResponse.Error != "" {
-			return fmt.Errorf("stream: %s", errorResponse.Error)
+			return fmt.Errorf(errorResponse.Error)
 		}
 
 		if response.StatusCode >= 400 {

filename: server/images.go
patch: @@ -684,7 +684,7 @@ func PullModel(name string, regOpts *RegistryOptions, fn func(api.ProgressRespon
 
 	manifest, err := pullModelManifest(mp, regOpts)
 	if err != nil {
-		return fmt.Errorf("pull model manifest: %q", err)
+		return fmt.Errorf("pull model manifest: %s", err)
 	}
 
 	var layers []*Layer
@@ -753,6 +753,9 @@ func pullModelManifest(mp ModelPath, regOpts *RegistryOptions) (*ManifestV2, err
 
 	// Check for success: For a successful upload, the Docker registry will respond with a 201 Created
 	if resp.StatusCode != http.StatusOK {
+		if resp.StatusCode == http.StatusNotFound {
+			return nil, fmt.Errorf("model not found")
+		}
 		body, _ := io.ReadAll(resp.Body)
 		return nil, fmt.Errorf("on pull registry responded with code %d: %s", resp.StatusCode, body)
 	}
Repository: vercel/next.js
Pull request: fix: amp deprecation warning should assert on user config

- The deprecation warning should only be logged when the apps have `amp` defined in `next.config.js`, not always logging it. Follow up of #82551

- Add deprecation as well for public type `PageConfig` from `next`

Changed files:
filename: packages/next/src/server/config.ts
patch: @@ -161,6 +161,26 @@ function assignDefaults(
     delete userConfig.exportTrailingSlash
   }
 
+  // There are a good amount of test fixtures that have amp enabled
+  // that also assert on stderr output being empty, so we're gating the
+  // warning to be skipped when running in Next.js tests until we fully
+  // remove the feature.
+  if (!process.env.__NEXT_TEST_MODE) {
+    warnOptionHasBeenDeprecated(
+      userConfig,
+      'amp',
+      `Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`,
+      silent
+    )
+
+    warnOptionHasBeenDeprecated(
+      userConfig,
+      'experimental.amp',
+      `Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`,
+      silent
+    )
+  }
+
   // Handle deprecation of experimental.dynamicIO and migrate to experimental.cacheComponents
   if (userConfig.experimental?.dynamicIO !== undefined) {
     warnOptionHasBeenDeprecated(
@@ -503,26 +523,6 @@ function assignDefaults(
     }
   }
 
-  // There are a good amount of test fixtures that have amp enabled
-  // that also assert on stderr output being empty, so we're gating the
-  // warning to be skipped when running in Next.js tests until we fully
-  // remove the feature.
-  if (!process.env.__NEXT_TEST_MODE) {
-    warnOptionHasBeenDeprecated(
-      result,
-      'amp',
-      `Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`,
-      silent
-    )
-
-    warnOptionHasBeenDeprecated(
-      result,
-      'experimental.amp',
-      `Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`,
-      silent
-    )
-  }
-
   warnCustomizedOption(
     result,
     'experimental.esmExternals',

filename: packages/next/src/types.ts
patch: @@ -114,6 +114,10 @@ export type ResponseLimit = SizeLimit | boolean
  * `Config` type, use it for export const config
  */
 export type PageConfig = {
+  /**
+   * @deprecated built-in amp support will be removed in Next 16
+   * @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp)
+   */
   amp?: boolean | 'hybrid'
   api?: {
     /**
Repository: ggml-org/llama.cpp
Pull request: opencl: fix FA for f32

The FA f32 kernel treated mask as f32, which should be f16 instead.

Changed files:
filename: ggml/src/ggml-opencl/kernels/flash_attn_f32.cl
patch: @@ -4,6 +4,7 @@
 #define ACC_TYPE4 float4
 #define DATA_TYPE float
 #define DATA_TYPE4 float4
+#define MASK_DATA_TYPE half
 #define CONVERT_ACC4(x) (x)
 #define CONVERT_DATA4(x) (x)
 
@@ -148,7 +149,7 @@ __kernel void flash_attn_f32(
             if (k_row1 >= n_kv) score1 = -INFINITY;
 
             if (mask_base != NULL) {
-                const global DATA_TYPE* mask_ptr = (const global DATA_TYPE*)(mask_base + my_query_row * mask_nb1);
+                const global MASK_DATA_TYPE* mask_ptr = (const global MASK_DATA_TYPE*)(mask_base + my_query_row * mask_nb1);
                 if (k_row0 < n_kv) score0 += slope * (ACC_TYPE)mask_ptr[k_row0];
                 if (k_row1 < n_kv) score1 += slope * (ACC_TYPE)mask_ptr[k_row1];
             }
@@ -281,7 +282,7 @@ __kernel void flash_attn_f32_q1(
         }
         ACC_TYPE score = (dot_acc.s0 + dot_acc.s1 + dot_acc.s2 + dot_acc.s3) * scale;
         if (mask_base != NULL) {
-            const global DATA_TYPE* mask_ptr = (const global DATA_TYPE*)(mask_base);
+            const global MASK_DATA_TYPE* mask_ptr = (const global MASK_DATA_TYPE*)(mask_base);
             score += slope * (ACC_TYPE)mask_ptr[k_idx];
         }
         if (logit_softcap > 0.0f) {
@@ -317,7 +318,7 @@ __kernel void flash_attn_f32_q1(
         }
         ACC_TYPE score = (dot_acc.s0 + dot_acc.s1 + dot_acc.s2 + dot_acc.s3) * scale;
         if (mask_base != NULL) {
-            const global DATA_TYPE* mask_ptr = (const global DATA_TYPE*)(mask_base);
+            const global MASK_DATA_TYPE* mask_ptr = (const global MASK_DATA_TYPE*)(mask_base);
             score += slope * (ACC_TYPE)mask_ptr[k_idx];
         }
         if (logit_softcap > 0.0f) {
Repository: ollama/ollama
Pull request: set non-zero error code on error

ollama should exit non-zero when operations fail

Changed files:
filename: cmd/cmd.go
patch: @@ -78,6 +78,7 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 			spinner = NewSpinner(resp.Status)
 			go spinner.Spin(100 * time.Millisecond)
 		}
+
 		return nil
 	}
 
@@ -87,6 +88,9 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 
 	if spinner != nil {
 		spinner.Stop()
+		if spinner.description != "success" {
+			return errors.New("unexpected end to create model")
+		}
 	}
 
 	return nil
@@ -155,6 +159,11 @@ func PushHandler(cmd *cobra.Command, args []string) error {
 	if err := client.Push(context.Background(), &request, fn); err != nil {
 		return err
 	}
+
+	if bar != nil && !bar.IsFinished() {
+		return errors.New("unexpected end to push model")
+	}
+
 	return nil
 }
 
@@ -253,12 +262,18 @@ func pull(model string, insecure bool) error {
 			currentDigest = ""
 			fmt.Println(resp.Status)
 		}
+
 		return nil
 	}
 
 	if err := client.Pull(context.Background(), &request, fn); err != nil {
 		return err
 	}
+
+	if bar != nil && !bar.IsFinished() {
+		return errors.New("unexpected end to pull model")
+	}
+
 	return nil
 }
 
@@ -325,6 +340,10 @@ func generate(cmd *cobra.Command, model, prompt string) error {
 		fmt.Println()
 		fmt.Println()
 
+		if !latest.Done {
+			return errors.New("unexpected end of response")
+		}
+
 		verbose, err := cmd.Flags().GetBool("verbose")
 		if err != nil {
 			return err
@@ -688,9 +707,10 @@ func NewCLI() *cobra.Command {
 	log.SetFlags(log.LstdFlags | log.Lshortfile)
 
 	rootCmd := &cobra.Command{
-		Use:          "ollama",
-		Short:        "Large language model runner",
-		SilenceUsage: true,
+		Use:           "ollama",
+		Short:         "Large language model runner",
+		SilenceUsage:  true,
+		SilenceErrors: true,
 		CompletionOptions: cobra.CompletionOptions{
 			DisableDefaultCmd: true,
 		},

filename: main.go
patch: @@ -4,8 +4,9 @@ import (
 	"context"
 
 	"github.com/jmorganca/ollama/cmd"
+	"github.com/spf13/cobra"
 )
 
 func main() {
-	cmd.NewCLI().ExecuteContext(context.Background())
+	cobra.CheckErr(cmd.NewCLI().ExecuteContext(context.Background()))
 }
Repository: ggml-org/llama.cpp
Pull request: server : fix img token logs

fix https://github.com/ggml-org/llama.cpp/pull/16591#issuecomment-3406486458

Changed files:
filename: tools/server/server.cpp
patch: @@ -3839,14 +3839,14 @@ struct server_context {
 
                                         {
                                             const auto token = slot.prompt.tokens[i];
-                                            const auto piece = common_token_to_piece(ctx, token);
+                                            const auto piece = token != LLAMA_TOKEN_NULL ? common_token_to_piece(ctx, token) : "[mtmd]";
                                             ss0 << piece;
                                             st0 << std::setw(8) << token;
                                         }
 
                                         {
                                             const auto token = slot.task->tokens[i];
-                                            const auto piece = common_token_to_piece(ctx, token);
+                                            const auto piece = token != LLAMA_TOKEN_NULL ? common_token_to_piece(ctx, token) : "[mtmd]";
                                             ss1 << piece;
                                             st1 << std::setw(8) << token;
                                         }
Repository: electron/electron
Pull request: fix: flicker and ghosting in transparent windows on macOS

Backport of #46353

See that PR for details.


Notes: Fixed flickering and ghosting artifacts in transparent windows on macOS.


Changed files:
filename: shell/browser/native_window_mac.mm
patch: @@ -196,6 +196,9 @@ static bool FromV8(v8::Isolate* isolate,
   params.type = views::Widget::InitParams::TYPE_WINDOW;
   // Allow painting before shown, to be later disabled in ElectronNSWindow.
   params.headless_mode = true;
+  if (IsTranslucent()) {
+    params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
+  }
   params.native_widget =
       new ElectronNativeWidgetMac(this, windowType, styleMask, widget());
   widget()->Init(std::move(params));
Repository: denoland/deno
Pull request: fix(tests): use correct path separator on unix for code_cache cleanup.ts

This has been causing failures on multiple PRs.

Changed files:
filename: tests/specs/compile/code_cache/cleanup.ts
patch: @@ -5,7 +5,7 @@ try {
   if (Deno.build.os === "windows") {
     Deno.removeSync(tmpdir() + "\\deno-compile-using_code_cache.exe.cache");
   } else {
-    Deno.removeSync(tmpdir() + "\\deno-compile-using_code_cache.cache");
+    Deno.removeSync(tmpdir() + "/deno-compile-using_code_cache.cache");
   }
 } catch {
 }
Repository: facebook/react
Pull request: Restore global window.event after event dispatching (#13688)

Used @ConradIrwin [suggestion](https://github.com/facebook/react/issues/13688#issuecomment-422939757) to fix #13688.

Changed files:
filename: packages/shared/invokeGuardedCallbackImpl.js
patch: @@ -98,6 +98,13 @@ if (__DEV__) {
       // browsers that support it.
       let windowEvent = window.event;
 
+      // Keeps track of the descriptor of window.event to restore it after event
+      // dispatching: https://github.com/facebook/react/issues/13688
+      const windowEventDescriptor = Object.getOwnPropertyDescriptor(
+        window,
+        'event',
+      );
+
       // Create an event handler for our fake event. We will synchronously
       // dispatch our fake event using `dispatchEvent`. Inside the handler, we
       // call the user-provided callback.
@@ -172,6 +179,10 @@ if (__DEV__) {
       evt.initEvent(evtType, false, false);
       fakeNode.dispatchEvent(evt);
 
+      if (windowEventDescriptor) {
+        Object.defineProperty(window, 'event', windowEventDescriptor);
+      }
+
       if (didError) {
         if (!didSetError) {
           // The callback errored, but the error event never fired.
Repository: ollama/ollama
Pull request: DockerIt example

This is a simple example of a model to generate Dockerfiles, along with a Python script to build and run the resulting docker image.

Changed files:
filename: examples/dockerit/Modelfile
patch: @@ -0,0 +1,20 @@
+FROM llama2
+SYSTEM """
+You are an experience Devops engineer focused on docker. When given specifications for a particular need or application you know the best way to host that within a docker container. For instance if someone tells you they want an nginx server to host files located at /web you will answer as follows
+
+---start
+FROM nginx:alpine
+COPY /myweb /usr/share/nginx/html
+EXPOSE 80
+---end
+
+Notice that the answer you should give is just the contents of the dockerfile with no explanation and there are three dashes and the word start at the beginning and 3 dashes and the word end. The full output can be piped into a file and run as is. Here is another example. The user will ask to launch a Postgres server with a password of abc123. And the response should be
+
+---start
+FROM postgres:latest
+ENV POSTGRES_PASSWORD=abc123
+EXPOSE 5432
+---end
+
+Again it's just the contents of the dockerfile an nothing else.
+"""
\ No newline at end of file

filename: examples/dockerit/README.md
patch: @@ -0,0 +1,15 @@
+# DockerIt
+
+DockerIt is a tool to help you build and run your application in a Docker container. It consists of a model that defines the system prompt and model weights to use, along with a python script to then build the container and run the image automatically. 
+
+## Caveats
+
+This is an simple example. It's assuming the Dockerfile content generated is going to work. In many cases, even with simple web servers, it fails when trying to copy files that don't exist. It's simply an example of what you could possibly do.
+
+## Example Usage
+
+```bash
+> python3 ./dockerit.py "simple postgres server with admin password set to 123"
+Enter the name of the image: matttest
+Container named happy_keller  started with id:  7c201bb6c30f02b356ddbc8e2a5af9d7d7d7b8c228519c9a501d15c0bd9d6b3e
+```

filename: examples/dockerit/dockerit.py
patch: @@ -0,0 +1,17 @@
+import requests, json, docker, io, sys
+inputDescription = " ".join(sys.argv[1:])
+imageName = input("Enter the name of the image: ")
+client = docker.from_env()
+s = requests.Session()
+output=""
+with s.post('http://localhost:11434/api/generate', json={'model': 'dockerit', 'prompt': inputDescription}, stream=True) as r:
+  for line in r.iter_lines():
+    if line:
+      j = json.loads(line)
+      if "response" in j:
+        output = output +j["response"]
+output = output[output.find("---start")+9:output.find("---end")-1]
+f = io.BytesIO(bytes(output, 'utf-8'))
+client.images.build(fileobj=f, tag=imageName)
+container = client.containers.run(imageName, detach=True)
+print("Container named", container.name, " started with id: ",container.id)

filename: examples/dockerit/requirements.txt
patch: @@ -0,0 +1 @@
+docker
\ No newline at end of file
Repository: denoland/deno
Pull request: fix(ext/node): make some `os` exported properties read only

These only occurs when importing using `require('os')`, since ES module imports already make it non-writeable. Changes are based on Node.js original implementation [here](https://github.com/nodejs/node/blob/591ba692bfe30408e6a67397e7d18bfa1b9c3561/lib/os.js#L333-L356). This allows [test-os-eol.js](https://github.com/nodejs/node/blob/v24.2.0/test/parallel/test-os-eol.js) to pass.

Changed files:
filename: ext/node/polyfills/os.ts
patch: @@ -38,7 +38,12 @@ import { os } from "ext:deno_node/internal_binding/constants.ts";
 import { osUptime } from "ext:deno_os/30_os.js";
 import { Buffer } from "ext:deno_node/internal/buffer.mjs";
 import { primordials } from "ext:core/mod.js";
-const { StringPrototypeEndsWith, StringPrototypeSlice } = primordials;
+
+const {
+  ObjectDefineProperties,
+  StringPrototypeEndsWith,
+  StringPrototypeSlice,
+} = primordials;
 
 export const constants = os;
 
@@ -359,7 +364,7 @@ export function availableParallelism(): number {
 export const EOL = isWindows ? "\r\n" : "\n";
 export const devNull = isWindows ? "\\\\.\\nul" : "/dev/null";
 
-export default {
+const mod = {
   availableParallelism,
   arch,
   cpus,
@@ -380,7 +385,31 @@ export default {
   uptime,
   userInfo,
   version,
-  constants,
-  EOL,
-  devNull,
 };
+
+ObjectDefineProperties(mod, {
+  constants: {
+    __proto__: null,
+    configurable: false,
+    enumerable: true,
+    value: constants,
+  },
+  EOL: {
+    __proto__: null,
+    configurable: true,
+    enumerable: true,
+    writable: false,
+    value: EOL,
+  },
+  devNull: {
+    __proto__: null,
+    configurable: true,
+    enumerable: true,
+    writable: false,
+    value: devNull,
+  },
+});
+
+// NB(Tango992): we want to have a default exports from this module for ES imports,
+// as well as make it work with `require` in such a way that the object properties are set correctly.
+export { mod as "module.exports", mod as default };

filename: tests/node_compat/config.toml
patch: @@ -806,6 +806,7 @@
 "parallel/test-next-tick.js" = {}
 "parallel/test-no-node-snapshot.js" = {}
 "parallel/test-nodeeventtarget.js" = {}
+"parallel/test-os-eol.js" = {}
 "parallel/test-os-homedir-no-envvar.js" = {}
 "parallel/test-os-userinfo-handles-getter-errors.js" = {}
 "parallel/test-os.js" = {}
Repository: denoland/deno
Pull request: fix: upgrade deno_core to 0.355.0

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->

ref https://github.com/denoland/deno_core/pull/1175

Changed files:
filename: Cargo.lock
patch: @@ -1848,9 +1848,9 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.354.0"
+version = "0.355.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cfe32c94bf6e813fc2ca43297f4b889f4e48936ca19a13e3b44035831afc2b1"
+checksum = "775d2fde80a2ec3116d179703b38346a931bb9626f4a826148d5fe8631cab29f"
 dependencies = [
  "anyhow",
  "az",
@@ -2553,9 +2553,9 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.230.0"
+version = "0.231.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37d5c0a6ce557921de6f2c84edbf618316919a6850be1018ce29a0899bf5ddaa"
+checksum = "9ca530772bbcbc9ad389ad7bcd86623b2ec555f68a2d062d23cc008915cbe781"
 dependencies = [
  "indexmap 2.9.0",
  "proc-macro-rules",
@@ -7926,9 +7926,9 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.263.0"
+version = "0.264.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84c52db6612cdce22977d3b4757966a0b92a53b31d840859edc478c01e479bdd"
+checksum = "c34707712f3815e73e1c8319bba06e5bc105bb65fe812ea2e7279ffb905f6312"
 dependencies = [
  "deno_error",
  "num-bigint",

filename: Cargo.toml
patch: @@ -60,7 +60,7 @@ repository = "https://github.com/denoland/deno"
 
 [workspace.dependencies]
 deno_ast = { version = "=0.49", features = ["transpiling"] }
-deno_core = { version = "0.354.0" }
+deno_core = { version = "0.355.0" }
 
 deno_cache_dir = "=0.24.0"
 deno_doc = "=0.181.0"

filename: ext/node/ops/handle_wrap.rs
patch: @@ -182,8 +182,8 @@ impl HandleWrap {
   //
   // https://github.com/nodejs/node/blob/038d82980ab26cd79abe4409adc2fecad94d7c93/src/handle_wrap.cc#L40-L46
   #[fast]
-  #[rename("r#ref")]
-  fn ref_(&self, state: &mut OpState) {
+  #[rename("ref")]
+  fn ref_method(&self, state: &mut OpState) {
     if self.is_alive()
       && let Some(handle) = self.handle
     {
Repository: ggml-org/llama.cpp
Pull request: CUDA: Changing the CUDA scheduling strategy to spin

The PR [#16308](https://github.com/ggml-org/llama.cpp/pull/16308) sets as device property by default `integrated = false` to disable host buffers. While this change is needed, the additional memory copies introduce multiple `cudaStreamSynchronize` calls. With the default scheduling strategy, each synchronization has a small latency between kernel termination and freeing the CPU thread on sm121, leading to a ~15% performance regression on gpt-oss-20b-mxfp4. This can be fixed by setting the default scheduling strategy to `cudaDeviceScheduleSpin`. With the missing latency for each synchronization, the performance is roughly equal as handling the device as integrated.

This code change checks whether the device has compute capability 12.1 and then sets the CUDA flag `cudaDeviceScheduleSpin`.

Changed files:
filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -273,6 +273,15 @@ static ggml_cuda_device_info ggml_cuda_init() {
         } else if (device_name.substr(0, 21) == "NVIDIA GeForce GTX 16") {
             turing_devices_without_mma.push_back({ id, device_name });
         }
+
+        // Temporary performance fix:
+        // Setting device scheduling strategy for iGPUs with cc121 to "spinning" to avoid delays in cuda synchronize calls.
+        // TODO: Check for future drivers the default scheduling strategy and
+        // remove this call again when cudaDeviceScheduleSpin is default.
+        if (prop.major == 12 && prop.minor == 1) {
+            CUDA_CHECK(cudaSetDeviceFlags(cudaDeviceScheduleSpin));
+        }
+
 #endif  // defined(GGML_USE_HIP)
     }