helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: `shell.openPath` should be non-blocking

Backport of #48079

See that PR for details.


Notes: Fixed an issue where `shell.openPath` was not non-blocking as expected.

Changed files:
filename: shell/common/platform_util_linux.cc
patch: @@ -348,7 +348,7 @@ void ShowItemInFolder(const base::FilePath& full_path) {
 
 void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
   // This is async, so we don't care about the return value.
-  XDGOpen(full_path.DirName(), full_path.value(), true, std::move(callback));
+  XDGOpen(full_path.DirName(), full_path.value(), false, std::move(callback));
 }
 
 void OpenFolder(const base::FilePath& full_path) {
Repository: huggingface/transformers
Pull request: Be careful at explicit checkout actions

# What does this PR do?

Be careful at explicit checkout actions

Changed files:
filename: .github/workflows/codeql.yml
patch: @@ -3,7 +3,7 @@ name: CodeQL Security Analysis
 
 on:
   push:
-    branches: ["main"]
+    branches: ["main", "fix_security_issue_*"]
   # pull_request:
   #   branches: ["main"]
   workflow_dispatch:

filename: .github/workflows/slack-report.yml
patch: @@ -49,7 +49,8 @@ jobs:
       - uses: actions/checkout@v4
         with:
           fetch-depth: 2
-          ref: ${{ inputs.commit_sha || github.sha }}
+          # Security: checkout to the `main` branch for untrusted triggers (issue_comment, pull_request_target), otherwise use the specified ref
+          ref: ${{ (github.event_name == 'issue_comment' || github.event_name == 'pull_request_target') && 'main' || (inputs.commit_sha || github.sha) }}
 
       - uses: actions/download-artifact@v4
Repository: ggml-org/llama.cpp
Pull request: vulkan: Disable large coopmat matmul configuration on proprietary AMD driver

See https://github.com/ggml-org/llama.cpp/pull/18749#issuecomment-3735634824

Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -3002,7 +3002,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
         if ((device->architecture == AMD_GCN) && (device->driver_id != vk::DriverId::eAmdProprietary)) {
             m_warptile_mmq = m_warptile_mmq_int = { 256, 64, 64, 32, 16, 16, 2, 2, 2, 1, 16 };
             m_warptile_mmqid = m_warptile_mmqid_int = { 256, 64, 64, 32, 16, 16, 2, 2, 2, 1, 16 };
-        } else if (device->vendor_id == VK_VENDOR_ID_AMD && device->coopmat_support) {
+        } else if (device->vendor_id == VK_VENDOR_ID_AMD && device->coopmat_support && device->driver_id != vk::DriverId::eAmdProprietary) {
             // This is intentionally using tx_m values, slight performance increase
             l_warptile = { 256, 128, 128, 16, subgroup_size_8, 64, 2, tm_m, tn_m, tk_m, subgroup_size_8 };
             l_warptile_mmq = l_warptile_mmq_int = { 256, 128, 128, 32, subgroup_size_8, 64, 2, tm_m, tn_m, tk_m, subgroup_size_8 };
@@ -5083,7 +5083,7 @@ static vk_device ggml_vk_get_device(size_t idx) {
             switch (device->vendor_id) {
 #ifndef GGML_VULKAN_RUN_TESTS
             case VK_VENDOR_ID_AMD:
-                device->mul_mat_l[i]    = device->coopmat_support;
+                device->mul_mat_l[i]    = device->coopmat_support && device->driver_id != vk::DriverId::eAmdProprietary;
                 device->mul_mat_m[i]    = true;
                 device->mul_mat_s[i]    = true;
                 device->mul_mat_id_l[i] = false;
Repository: ollama/ollama
Pull request: types/model: remove Digest

The Digest type in its current form is awkward to work with and presents challenges with regard to how it serializes via String using the '-' prefix.

We currently only use this in ollama.com, so we'll move our specific needs around digest parsing and validation there.

Changed files:
filename: types/model/name.go
patch: @@ -4,7 +4,6 @@ package model
 
 import (
 	"cmp"
-	"encoding/hex"
 	"errors"
 	"fmt"
 	"log/slog"
@@ -371,57 +370,3 @@ func cutPromised(s, sep string) (before, after string, ok bool) {
 	}
 	return cmp.Or(before, MissingPart), cmp.Or(after, MissingPart), true
 }
-
-type DigestType byte
-
-const (
-	DigestTypeInvalid DigestType = iota
-	DigestTypeSHA256
-)
-
-func (t DigestType) String() string {
-	switch t {
-	case DigestTypeSHA256:
-		return "sha256"
-	default:
-		return "invalid"
-	}
-}
-
-type Digest struct {
-	Type DigestType
-	Sum  [32]byte
-}
-
-func ParseDigest(s string) (Digest, error) {
-	i := strings.IndexAny(s, "-:")
-	if i < 0 {
-		return Digest{}, fmt.Errorf("invalid digest %q", s)
-	}
-	typ, encSum := s[:i], s[i+1:]
-	if typ != "sha256" {
-		return Digest{}, fmt.Errorf("unsupported digest type %q", typ)
-	}
-	d := Digest{
-		Type: DigestTypeSHA256,
-	}
-	n, err := hex.Decode(d.Sum[:], []byte(encSum))
-	if err != nil {
-		return Digest{}, err
-	}
-	if n != 32 {
-		return Digest{}, fmt.Errorf("digest %q decoded to %d bytes; want 32", encSum, n)
-	}
-	return d, nil
-}
-
-func (d Digest) String() string {
-	if d.Type == DigestTypeInvalid {
-		return ""
-	}
-	return fmt.Sprintf("sha256-%x", d.Sum)
-}
-
-func (d Digest) IsValid() bool {
-	return d.Type != DigestTypeInvalid
-}

filename: types/model/name_test.go
patch: @@ -284,40 +284,6 @@ func TestFilepathAllocs(t *testing.T) {
 	}
 }
 
-const (
-	validSha256    = "sha256-1000000000000000000000000000000000000000000000000000000000000000"
-	validSha256Old = "sha256:1000000000000000000000000000000000000000000000000000000000000000"
-)
-
-func TestParseDigest(t *testing.T) {
-	cases := []struct {
-		in   string
-		want string
-	}{
-		{"", ""},           // empty
-		{"sha123-12", ""},  // invalid type
-		{"sha256-", ""},    // invalid sum
-		{"sha256-123", ""}, // invalid odd length sum
-
-		{validSha256, validSha256},
-		{validSha256Old, validSha256},
-	}
-	for _, tt := range cases {
-		t.Run(tt.in, func(t *testing.T) {
-			got, err := ParseDigest(tt.in)
-			if err != nil {
-				if tt.want != "" {
-					t.Errorf("parseDigest(%q) = %v; want %v", tt.in, err, tt.want)
-				}
-				return
-			}
-			if got.String() != tt.want {
-				t.Errorf("parseDigest(%q).String() = %q; want %q", tt.in, got, tt.want)
-			}
-		})
-	}
-}
-
 func TestParseNameFromFilepath(t *testing.T) {
 	cases := map[string]Name{
 		filepath.Join("host", "namespace", "model", "tag"):      {Host: "host", Namespace: "namespace", Model: "model", Tag: "tag"},
Repository: vercel/next.js
Pull request: [test] Move remaining `experimental.cacheLife`

Follow-up to https://github.com/vercel/next.js/pull/85050

Changed files:
filename: test/e2e/app-dir/app-static/next.config.js
patch: @@ -3,13 +3,11 @@ module.exports = {
   logging: {
     fetches: {},
   },
-  experimental: {
-    cacheLife: {
-      expireNow: {
-        stale: 0,
-        expire: 0,
-        revalidate: 0,
-      },
+  cacheLife: {
+    expireNow: {
+      stale: 0,
+      expire: 0,
+      revalidate: 0,
     },
   },
   cacheHandler: process.env.CUSTOM_CACHE_HANDLER
Repository: ggml-org/llama.cpp
Pull request: model: fix qwen3next broken due to #18683

Fix https://github.com/ggml-org/llama.cpp/issues/18761


Changed files:
filename: src/models/qwen3next.cpp
patch: @@ -590,6 +590,7 @@ std::pair<ggml_tensor *, ggml_tensor *> llm_build_qwen3next::build_qkvz(
         ggml_tensor * z = ggml_view_4d(ctx0, mixed_qkvz_reshaped, split_sizes_qkvz[3], num_k_heads, n_seq_tokens, n_seqs,
                                     mixed_qkvz_reshaped->nb[1], mixed_qkvz_reshaped->nb[2], mixed_qkvz_reshaped->nb[3],
                                     (split_sizes_qkvz[0] + split_sizes_qkvz[1] + split_sizes_qkvz[2]) * ggml_element_size(mixed_qkvz_reshaped));
+        z = ggml_cont(ctx0, z);
         cb(z, "z", il);
 
         // After creating query, key, and value_reshaped, reshape each to flatten the head dimensions
Repository: facebook/react
Pull request: temporarily disable lazy context propagation

disables lazy context propagation in oss to help determine if it is causing bugs in startTransition. Will reenable after cutting a canary release with this flag disabled

Changed files:
filename: packages/shared/ReactFeatureFlags.js
patch: @@ -101,7 +101,7 @@ export const enableObjectFiber = false;
 
 export const enableTransitionTracing = false;
 
-export const enableLazyContextPropagation = true;
+export const enableLazyContextPropagation = false;
 
 // Expose unstable useContext for performance testing
 export const enableContextProfiling = false;
Repository: ggml-org/llama.cpp
Pull request: security: make it clear about subtopics in server

Make it clear which parts of the server are excluded.

MCP is mentioned here because we will have stdio implementation in the future (provided by `subprocess.h`), as well as a CORS proxy. These features are unsafe to be used publicly, it's only intended to be used via localhost or private deployment.


Changed files:
filename: SECURITY.md
patch: @@ -38,7 +38,11 @@ Only vulnerabilities that fall within these parts of the project are considered
 - `src/**/*`
 - `ggml/**/*`
 - `gguf-py/**/*`
-- `tools/server/*` (note: Web UI is not covered)
+- `tools/server/*`, **excluding** the following topics:
+    - Web UI
+    - Features marked as experimental
+    - Features not recommended for use in untrusted environments (e.g., router, MCP)
+    - Bugs that can lead to Denial-of-Service attack
 
 Note that none of the topics under [Using llama.cpp securely](#using-llamacpp-securely) are considered vulnerabilities in LLaMA C++.
Repository: electron/electron
Pull request: fix: `shell.openPath` should be non-blocking

Backport of #48079

See that PR for details.


Notes: Fixed an issue where `shell.openPath` was not non-blocking as expected.

Changed files:
filename: shell/common/platform_util_linux.cc
patch: @@ -342,7 +342,7 @@ void ShowItemInFolder(const base::FilePath& full_path) {
 
 void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
   // This is async, so we don't care about the return value.
-  XDGOpen(full_path.DirName(), full_path.value(), true, std::move(callback));
+  XDGOpen(full_path.DirName(), full_path.value(), false, std::move(callback));
 }
 
 void OpenFolder(const base::FilePath& full_path) {
Repository: vuejs/vue
Pull request: Test priorities.

Prevent error like #2573 from happening again.


Changed files:
filename: test/unit/specs/directives/public/for/for_spec.js
patch: @@ -107,6 +107,28 @@ describe('v-for', function () {
     expect(el.innerHTML).toBe('<div>aaa a</div><div>bbb b</div>')
   })
 
+  it('check priorities: v-if before v-for', function () {
+    new Vue({
+      el: el,
+      data: {
+        items: [1, 2, 3]
+      },
+      template: '<div v-if="item < 3" v-for="item in items">{{item}}</div>'
+    })
+    expect(el.textContent).toBe('12')
+  })
+
+  it('check priorities: v-if after v-for', function () {
+    new Vue({
+      el: el,
+      data: {
+        items: [1, 2, 3]
+      },
+      template: '<div v-for="item in items" v-if="item < 3">{{item}}</div>'
+    })
+    expect(el.textContent).toBe('12')
+  })
+
   it('component', function (done) {
     var vm = new Vue({
       el: el,
Repository: huggingface/transformers
Pull request: Fix transformers serve following chat template output update

cc @Rocketknight1 :)

Changed files:
filename: src/transformers/cli/serve.py
patch: @@ -813,7 +813,7 @@ def continuous_batching_chat_completion(self, req: dict, request_id: str) -> Str
         # TODO (Joao, Lysandre): this should also work with tool support
         inputs = processor.apply_chat_template(req["messages"], return_tensors="pt", add_generation_prompt=True).to(
             model.device
-        )[0]
+        )["input_ids"][0]
 
         def stream_chat_completion(request_id, decode_stream):
             try:
@@ -1237,7 +1237,7 @@ def generate_response(self, req: dict) -> Generator[str, None, None]:
         else:
             raise TypeError("inputs should be a list, dict, or str")
 
-        inputs = processor.apply_chat_template(inputs, add_generation_prompt=True, return_tensors="pt")
+        inputs = processor.apply_chat_template(inputs, add_generation_prompt=True, return_tensors="pt")["input_ids"]
         inputs = inputs.to(model.device)
         request_id = req.get("previous_response_id", "req_0")
 
@@ -1541,7 +1541,7 @@ def generate_response_non_streaming(self, req: dict) -> dict:
         else:
             raise ValueError("inputs should be a list, dict, or str")
 
-        inputs = processor.apply_chat_template(inputs, add_generation_prompt=True, return_tensors="pt")
+        inputs = processor.apply_chat_template(inputs, add_generation_prompt=True, return_tensors="pt")["input_ids"]
         inputs = inputs.to(model.device)
         request_id = req.get("previous_response_id", "req_0")
Repository: nodejs/node
Pull request: src: fix small compile warning in quic/streams.cc

Fixes: https://github.com/nodejs/node/issues/60110



Changed files:
filename: src/quic/defs.h
patch: @@ -318,7 +318,7 @@ constexpr uint64_t kMaxSizeT = std::numeric_limits<size_t>::max();
 constexpr uint64_t kMaxSafeJsInteger = 9007199254740991;
 constexpr auto kSocketAddressInfoTimeout = 60 * NGTCP2_SECONDS;
 constexpr size_t kMaxVectorCount = 16;
-constexpr size_t kMaxStreamId = std::numeric_limits<stream_id>::max();
+constexpr stream_id kMaxStreamId = std::numeric_limits<stream_id>::max();
 
 class DebugIndentScope final {
  public:
Repository: ollama/ollama
Pull request: deepseek v2 graph

Fixes #5113
Fixes #4799 

Changed files:
filename: llm/ggml.go
patch: @@ -367,6 +367,17 @@ func (llm GGML) GraphSize(context, batch uint64) (partialOffload, fullOffload ui
 			4*batch*(vocab+2*embedding),
 			fullOffload,
 		)
+	case "deepseek2":
+		keys := uint64(llm.KV()["deepseek2.attention.key_length"].(uint32))
+		fullOffload = max(
+			4*batch*(3*embedding+vocab),
+			4*batch*(3*embedding+2+context*(1+headsKV)+2*keys*headsKV),
+		)
+
+		partialOffload = max(
+			4*batch*(3*embedding+vocab)+embedding*vocab*105/128,
+			4*batch*(2*embedding+1+2*keys*headsKV+context+context*headsKV)+4*keys*context*headsKV+embedding*keys*headsKV*9/16,
+		)
 	}
 
 	return
Repository: vercel/next.js
Pull request: [CNA] Do not prompt for Turbopack

Remove the Turbopack prompt as it's enabled by default. `--turbopack` option is still available to match bundler options (`--webpack`, `--rspack`) but is noop.

Changed files:
filename: docs/01-app/01-getting-started/01-installation.mdx
patch: @@ -77,7 +77,6 @@ Would you like to use React Compiler? No / Yes
 Would you like to use Tailwind CSS? No / Yes
 Would you like your code inside a `src/` directory? No / Yes
 Would you like to use App Router? (recommended) No / Yes
-Would you like to use Turbopack? (recommended) No / Yes
 Would you like to customize the import alias (`@/*` by default)? No / Yes
 What import alias would you like configured? @/*
 ```

filename: docs/01-app/03-api-reference/06-cli/create-next-app.mdx
patch: @@ -76,7 +76,6 @@ Would you like to use React Compiler? No / Yes
 Would you like to use Tailwind CSS? No / Yes
 Would you like your code inside a `src/` directory? No / Yes
 Would you like to use App Router? (recommended) No / Yes
-Would you like to use Turbopack? (recommended) No / Yes
 Would you like to customize the import alias (`@/*` by default)? No / Yes
 What import alias would you like configured? @/*
 ```

filename: packages/create-next-app/index.ts
patch: @@ -241,7 +241,6 @@ async function run(): Promise<void> {
       importAlias: '@/*',
       customizeImportAlias: false,
       empty: false,
-      turbopack: true,
       disableGit: false,
       reactCompiler: false,
     }
@@ -261,7 +260,6 @@ async function run(): Promise<void> {
       { key: 'tailwind', values: { true: 'Tailwind CSS' } },
       { key: 'srcDir', values: { true: 'src/ dir' } },
       { key: 'app', values: { true: 'App Router', false: 'Pages Router' } },
-      { key: 'turbopack', values: { true: 'Turbopack' } },
     ]
 
     // Helper to format settings for display based on displayConfig
@@ -547,32 +545,6 @@ async function run(): Promise<void> {
       }
     }
 
-    if (
-      !opts.turbopack &&
-      !args.includes('--no-turbopack') &&
-      !opts.webpack &&
-      !opts.rspack
-    ) {
-      if (skipPrompt) {
-        opts.turbopack = getPrefOrDefault('turbopack')
-      } else {
-        const styledTurbo = blue('Turbopack')
-        const { turbopack } = await prompts({
-          onState: onPromptState,
-          type: 'toggle',
-          name: 'turbopack',
-          message: `Would you like to use ${styledTurbo}? (recommended)`,
-          initial: getPrefOrDefault('turbopack'),
-          active: 'Yes',
-          inactive: 'No',
-        })
-        opts.turbopack = Boolean(turbopack)
-        preferences.turbopack = Boolean(turbopack)
-      }
-      // If Turbopack is not selected, default to Webpack
-      opts.webpack = !opts.turbopack
-    }
-
     const importAliasPattern = /^[^*"]+\/\*\s*$/
     if (
       typeof opts.importAlias !== 'string' ||
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix FA FP16 accumulator overflow for Granite

Fixes https://github.com/ggml-org/llama.cpp/issues/18606 .

The problem seems to be the same as in https://github.com/ggml-org/llama.cpp/issues/17610 where extremal values in the V cache cause an overflow of the FP16 VKQ accumulators. It can be fixed by applying a more aggressive shift of the numerical range. On master it is being shifted by a factor of 2, with this PR it would increase to a factor of 8. The smallest representable value in the VKQ accumulators would then be $2^{-11}$ rather than $2^{-13}$.

Changed files:
filename: ggml/src/ggml-cuda/fattn-common.cuh
patch: @@ -11,10 +11,12 @@
 #define SOFTMAX_FTZ_THRESHOLD -20.0f                   // Softmax exp. of values smaller than this are flushed to zero to avoid NaNs.
 
 // log(2) = 0.6931, by adding this to the KQ maximum used for the softmax the numerical range representable
-//     by the VKQ accumulators is effectively being shifted up by a factor of 8.
+//     by the VKQ accumulators is effectively being shifted up by a factor of 2.
 // This reduces issues with numerical overflow but also causes larger values to be flushed to zero.
 // However, as the output from FlashAttention will usually be used as an input for a matrix multiplication this should be negligible.
-#define FATTN_KQ_MAX_OFFSET 0.6931f
+// Still, the value range should be shifted as much as necessary but as little as possible.
+// The macro on the following line shifts it by a factor of 2**3=8, as was needed to fix https://github.com/ggml-org/llama.cpp/issues/18606 .
+#define FATTN_KQ_MAX_OFFSET (3.0f*0.6931f)
 
 typedef void (* fattn_kernel_t)(
         const char * __restrict__ Q,
Repository: huggingface/transformers
Pull request: Annoying typo in attention error message

hi again ❤️  just found this annoying typo as a user

@Cyrilvallez maybe?

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -2424,7 +2424,7 @@ def get_correct_attn_implementation(self, requested_attention: Optional[str], is
             if self._supports_flash_attn or getattr(self, "_supports_flash_attn_2", False):
                 message += ', `"attn_implementation=flash_attention_3"`, `"attn_implementation=flash_attention_2"`, `"attn_implementation=paged|flash_attention_2"`'
             if self._supports_sdpa:
-                message += ', `"attn_implementation=sdpa"`, `"attn_implementation=paged|spda"`'
+                message += ', `"attn_implementation=sdpa"`, `"attn_implementation=paged|sdpa"`'
             if self._supports_flex_attn:
                 message += ', `"attn_implementation=flex_attention"`'
             raise ValueError(message + ".")
Repository: huggingface/transformers
Pull request: Avoid explicit checkout in workflow

# What does this PR do?

Avoid explicit checkout in workflow

Changed files:
filename: .github/workflows/self-scheduled.yml
patch: @@ -586,11 +586,10 @@ jobs:
     runs-on: ubuntu-22.04
     needs: [setup, run_models_gpu]
     steps:
+      # Checkout in order to run `utils/extract_warnings.py`. Avoid **explicit** checkout (i.e. don't specify `ref`) for
+      # security reason.
       - name: Checkout transformers
         uses: actions/checkout@v4
-        with:
-          fetch-depth: 2
-          ref: ${{ inputs.commit_sha || github.sha }}
 
       - name: Install transformers
         run: pip install transformers
Repository: nodejs/node
Pull request: build: fix flags for ngtcp2 on IBM i

similar to aix IBM i does not support certain network flags we are getting the following build errors:

```c
../deps/ngtcp2/ngtcp2/examples/shared.cc:68:63: error:
 'IPTOS_ECN_MASK' was not declared in this scope
   68 |         return *reinterpret_cast<uint8_t *>(CMSG_DATA(cmsg))
    & IPTOS_ECN_MASK;
      |                                                              
       ^~~~~~~~~~~~~~
../deps/ngtcp2/ngtcp2/examples/shared.cc:80:22: error:
 'IPTOS_ECN_MASK' was not declared in this scope
   80 |         return tos & IPTOS_ECN_MASK;
      |                      ^~~~~~~~~~~~~~
```


Changed files:
filename: deps/ngtcp2/ngtcp2.gyp
patch: @@ -272,7 +272,7 @@
         'HAVE_NETINET_IP_H',
       ],
       'conditions': [
-        ['OS=="aix" or OS=="win"', {
+        ['OS=="aix" or OS=="win" or OS=="os400"', {
           # AIX does not support some of the networking features used in
           # the test server. Windows also lacks the Unix-specific headers
           # and system calls required by the ngtcp2 examples.
@@ -330,7 +330,7 @@
         'HAVE_NETINET_IP_H',
       ],
       'conditions': [
-        ['OS=="aix" or OS=="win"', {
+        ['OS=="aix" or OS=="win" or OS=="os400"', {
           # AIX does not support some of the networking features used in
           # the test client. Windows also lacks the Unix-specific headers
           # and system calls required by the ngtcp2 examples.
Repository: ollama/ollama
Pull request: Actually skip PhysX on windows

Fixes #4984 

Changed files:
filename: gpu/gpu.go
patch: @@ -296,6 +296,7 @@ func FindGPULibs(baseLibName string, defaultPatterns []string) []string {
 		// Nvidia PhysX known to return bogus results
 		if strings.Contains(pattern, "PhysX") {
 			slog.Debug("skipping PhysX cuda library path", "path", pattern)
+			continue
 		}
 		// Ignore glob discovery errors
 		matches, _ := filepath.Glob(pattern)
Repository: ollama/ollama
Pull request: Handle models with divergent layer sizes

The recent refactoring of the memory prediction assumed all layers are the same size, but for some models (like deepseek-coder-v2) this is not the case, so our predictions were significantly off.


Without the fix:
```
time=2024-06-18T11:03:42.708-07:00 level=INFO source=memory.go:303 msg="offload to metal" layers.requested=-1 layers.model=28 layers.offload=28 layers.split="" memory.available="[96.0 GiB]" memory.required.full="2.4 GiB" memory.required.partial="2.4 GiB" memory.required.kv="432.0 MiB" memory.required.allocations="[2.4 GiB]" memory.weights.total="1.6 GiB" memory.weights.repeating="1.4 GiB" memory.weights.nonrepeating="164.1 MiB" memory.graph.full="72.0 MiB" memory.graph.partial="72.0 MiB"
```

With the fix:
```
time=2024-06-18T11:02:47.707-07:00 level=INFO source=memory.go:309 msg="offload to metal" layers.requested=-1 layers.model=28 layers.offload=28 layers.split="" memory.available="[96.0 GiB]" memory.required.full="9.2 GiB" memory.required.partial="9.2 GiB" memory.required.kv="432.0 MiB" memory.required.allocations="[9.2 GiB]" memory.weights.total="8.4 GiB" memory.weights.repeating="8.3 GiB" memory.weights.nonrepeating="164.1 MiB" memory.graph.full="72.0 MiB" memory.graph.partial="72.0 MiB"
```

Partial fix for #5113 but we'll need additional graph updates...

Changed files:
filename: llm/memory.go
patch: @@ -1,6 +1,7 @@
 package llm
 
 import (
+	"fmt"
 	"log/slog"
 	"strconv"
 	"strings"
@@ -179,6 +180,11 @@ func EstimateGPULayers(gpus []gpu.GpuInfo, ggml *GGML, projectors []string, opts
 
 	// For all the layers, find where they can fit on the GPU(s)
 	for i := range int(ggml.KV().BlockCount()) {
+		// Some models have inconsistent layer sizes
+		if blk, ok := layers[fmt.Sprintf("blk.%d", i)]; ok {
+			layerSize = blk.size()
+			layerSize += kv / ggml.KV().BlockCount()
+		}
 		memoryWeights += layerSize
 
 		if opts.NumGPU >= 0 && layerCount >= opts.NumGPU {