helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [performance_optim] define flash attention mask on NPU device directly

# What does this PR do?

When using Flash Attention2 on Ascend NPU, we have found that CPU memory keep increasing when calling func `npu_flash_attn_varlen_func` or `npu_flash_attn_func`. 

The root cause is that the attention mask generated by func `torch.ones()` is initially defined on the CPU side, occupying CPU memory before being transferred to the NPU device. As the func `npu_flash_attn_varlen_func` or `npu_flash_attn_func` is called repeatedly, the CPU memory consumption continues to accumulate, which is not optimal solution. Below is one example: https://github.com/huggingface/transformers/blob/12f65ee7520404b511c7fe716bc5d48d93d8297d/src/transformers/integrations/npu_flash_attention.py#L225

Therefore, this PR is committed for solving this problem by defining attention mask tensor with `torch.ones()` on NPU device directy.

Fixes # (issue)
Not releated.

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


Changed files:
filename: src/transformers/integrations/npu_flash_attention.py
patch: @@ -171,7 +171,7 @@ def npu_flash_attn_func(
         head_num = q.shape[2]
         output = torch_npu.npu_fusion_attention(q, k, v, head_num, "BSND", keep_prob=keep_prob, scale=softmax_scale)[0]
     else:
-        attn_mask_npu = torch.triu(torch.ones([2048, 2048]), diagonal=1).bool().to(q.device)
+        attn_mask_npu = torch.triu(torch.ones([2048, 2048], device=q.device), diagonal=1).bool()
         head_num = q.shape[2]
         output = torch_npu.npu_fusion_attention(
             q,
@@ -222,7 +222,7 @@ def npu_flash_attn_varlen_func(
             actual_seq_kvlen=tuple(cu_seqlens_k[1:].cpu().numpy().tolist()),
         )[0]
     else:
-        attn_mask_npu = torch.triu(torch.ones([2048, 2048]), diagonal=1).bool().to(q.device)
+        attn_mask_npu = torch.triu(torch.ones([2048, 2048], device=q.device), diagonal=1).bool()
         head_num = q.shape[1]
         output = torch_npu.npu_fusion_attention(
             q,
Repository: ggml-org/llama.cpp
Pull request: vulkan: Improve build time for MSVC

Enable CMP0147 so custom build steps (invoking vulkan-shader-gen) are run in parallel.

Enable /MP so source files are compiled in parallel.

#16341 made full shader rebuilds slower using MSVC due to reduced parallelism. This change enables two kinds of parallelism in the build. I think this is all MSVC-specific.

Build times before/after, for touching types.glsl, broken down into compiling the shaders and compiling the cpp files:
```
before: 55s + 26s
after: 29s + 15s
```
I think both steps are still limited by mul_mm being so much bigger than all the others, the improvement in parallelism is very clear when you see it in action.


Changed files:
filename: ggml/src/ggml-vulkan/CMakeLists.txt
patch: @@ -1,9 +1,18 @@
 cmake_minimum_required(VERSION 3.19)
 cmake_policy(SET CMP0114 NEW)
 cmake_policy(SET CMP0116 NEW)
+if (POLICY CMP0147)
+    # Parallel build custom build steps
+    cmake_policy(SET CMP0147 NEW)
+endif()
 
 find_package(Vulkan COMPONENTS glslc REQUIRED)
 
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+    # Parallel build object files
+    add_definitions(/MP)
+endif()
+
 function(detect_host_compiler)
     if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
         find_program(HOST_C_COMPILER NAMES cl gcc clang NO_CMAKE_FIND_ROOT_PATH)
Repository: ollama/ollama
Pull request: Decode ggml 2: Use decoded values


Changed files:
filename: go.mod
patch: @@ -32,6 +32,7 @@ require (
 	github.com/mattn/go-isatty v0.0.19 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
+	github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
 	github.com/pelletier/go-toml/v2 v2.0.8 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/twitchyliquid64/golang-asm v0.15.1 // indirect

filename: go.sum
patch: @@ -78,6 +78,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
 github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
+github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
+github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
 github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
 github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
 github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=

filename: llm/llm.go
patch: @@ -2,8 +2,11 @@ package llm
 
 import (
 	"fmt"
+	"log"
 	"os"
 
+	"github.com/pbnjay/memory"
+
 	"github.com/jmorganca/ollama/api"
 )
 
@@ -31,6 +34,36 @@ func New(model string, opts api.Options) (LLM, error) {
 		return nil, err
 	}
 
+	switch ggml.FileType {
+	case FileTypeF32, FileTypeF16, FileTypeQ5_0, FileTypeQ5_1, FileTypeQ8_0:
+		if opts.NumGPU != 0 {
+			// Q5_0, Q5_1, and Q8_0 do not support Metal API and will
+			// cause the runner to segmentation fault so disable GPU
+			log.Printf("WARNING: GPU disabled for F32, F16, Q5_0, Q5_1, and Q8_0")
+			opts.NumGPU = 0
+		}
+	}
+
+	totalResidentMemory := memory.TotalMemory()
+	switch ggml.ModelType {
+	case ModelType3B, ModelType7B:
+		if totalResidentMemory < 8*1024*1024 {
+			return nil, fmt.Errorf("model requires at least 8GB of memory")
+		}
+	case ModelType13B:
+		if totalResidentMemory < 16*1024*1024 {
+			return nil, fmt.Errorf("model requires at least 16GB of memory")
+		}
+	case ModelType30B:
+		if totalResidentMemory < 32*1024*1024 {
+			return nil, fmt.Errorf("model requires at least 32GB of memory")
+		}
+	case ModelType65B:
+		if totalResidentMemory < 64*1024*1024 {
+			return nil, fmt.Errorf("model requires at least 64GB of memory")
+		}
+	}
+
 	switch ggml.ModelFamily {
 	case ModelFamilyLlama:
 		return newLlama(model, opts)
Repository: ollama/ollama
Pull request: no warning on comments


Changed files:
filename: parser/parser.go
patch: @@ -52,8 +52,10 @@ func Parse(reader io.Reader) ([]Command, error) {
 			command.Name = string(fields[0])
 			command.Args = string(fields[1])
 		default:
-			// log a warning for unknown commands
-			log.Printf("WARNING: Unknown command: %s", fields[0])
+			if !bytes.HasPrefix(fields[0], []byte("#")) {
+				// log a warning for unknown commands
+				log.Printf("WARNING: Unknown command: %s", fields[0])
+			}
 			continue
 		}
Repository: electron/electron
Pull request: perf: remove isolate scope from DidProcessTask()

#### Description of Change

I was profiling Electron on Ubuntu 24.04 a bit with hotspot, and this section shows up pretty high due to the cost of  `ObtainCurrentThreadStackStart()` when calling `Isolate::Scope::Enter()`.

It's not clear to me that this line is actually needed here in `DidProcessTask()`. The line predates the Node microtasks fixup, going back to 0c711f690e6a50840e7866af87ed1cc1949bac37.

So this is a PR to remove it and see what CI and the other maintainers think of the idea.

CC @deepak1556 and @codebytere who probably have the best context to give a 2nd opinion on whether this Isolate::Scope is actually needed.

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Performance improvements when processing microtasks.

Changed files:
filename: shell/browser/microtasks_runner.cc
patch: @@ -17,7 +17,6 @@ void MicrotasksRunner::WillProcessTask(const base::PendingTask& pending_task,
                                        bool was_blocked_or_low_priority) {}
 
 void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
-  v8::Isolate::Scope scope(isolate_);
   // In the browser process we follow Node.js microtask policy of kExplicit
   // and let the MicrotaskRunner which is a task observer for chromium UI thread
   // scheduler run the microtask checkpoint. This worked fine because Node.js
Repository: nodejs/node
Pull request: test: update expected error message for macOS

It started failing on my machine recently, if I have to guess I'd say it's probably related to the recent 15.4 macOS update.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: test/parallel/test-module-loading-error.js
patch: @@ -28,7 +28,7 @@ const errorMessagesByPlatform = {
   win32: ['is not a valid Win32 application'],
   linux: ['file too short', 'Exec format error'],
   sunos: ['unknown file type', 'not an ELF file'],
-  darwin: ['file too short', 'not a mach-o file'],
+  darwin: ['file too short', 'not a mach-o file', 'not valid mach-o file'],
   aix: ['Cannot load module',
         'Cannot run a file that does not have a valid format.',
         'Exec format error'],
Repository: ollama/ollama
Pull request: fix could not convert int


Changed files:
filename: api/types.go
patch: @@ -218,13 +218,15 @@ func (opts *Options) FromMap(m map[string]interface{}) error {
 			if field.IsValid() && field.CanSet() {
 				switch field.Kind() {
 				case reflect.Int:
-					// when JSON unmarshals numbers, it uses float64 by default, not int
-					val, ok := val.(float64)
-					if !ok {
+					switch t := val.(type) {
+					case int64:
+						field.SetInt(t)
+					case float64:
+						// when JSON unmarshals numbers, it uses float64, not int
+						field.SetInt(int64(t))
+					default:
 						log.Printf("could not convert model parmeter %v to int, skipped", key)
-						continue
 					}
-					field.SetInt(int64(val))
 				case reflect.Bool:
 					val, ok := val.(bool)
 					if !ok {
Repository: facebook/react
Pull request: Fix crash running `yarn flags --sort flag`



## Summary

Fixes

```
$ yarn flags                        
yarn run v1.22.10
$ node ./scripts/flags/flags.js
/Users/sebastian.silbermann/react/scripts/flags/flags.js:323
      rowB[sortChannel].toString().localeCompare(rowA[sortChannel])
                        ^

TypeError: Cannot read properties of undefined (reading 'toString')
    at /Users/sebastian.silbermann/react/scripts/flags/flags.js:323:25
    at Array.sort (<anonymous>)
    at Object.<anonymous> (/Users/sebastian.silbermann/react/scripts/flags/flags.js:322:27)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49

Node.js v18.19.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

## How did you test this change?

- `yarn flags`
- `yarn flags --sort flags`


Changed files:
filename: scripts/flags/flags.js
patch: @@ -318,11 +318,15 @@ for (const flag of allFlagsUniqueFlags) {
 let sorted = table;
 if (isDiff || argv.sort) {
   const sortChannel = argToHeader(isDiff ? argv.diff[0] : argv.sort);
-  sorted = Object.fromEntries(
-    Object.entries(table).sort(([, rowA], [, rowB]) =>
-      rowB[sortChannel].toString().localeCompare(rowA[sortChannel])
-    )
-  );
+  const sortBy =
+    sortChannel === 'flag'
+      ? ([flagA], [flagB]) => {
+          return flagA.localeCompare(flagB);
+        }
+      : ([, rowA], [, rowB]) => {
+          return rowB[sortChannel].toString().localeCompare(rowA[sortChannel]);
+        };
+  sorted = Object.fromEntries(Object.entries(table).sort(sortBy));
 }
 
 if (argv.csv) {
Repository: denoland/deno
Pull request: fix(ext/node): assign 'ERR_BUFFER_TOO_LARGE' to codes

Closes https://github.com/denoland/deno/issues/30310

Changed files:
filename: ext/node/polyfills/internal/errors.ts
patch: @@ -2742,6 +2742,7 @@ export class NodeAggregateError extends AggregateError {
   }
 }
 
+codes.ERR_BUFFER_TOO_LARGE = ERR_BUFFER_TOO_LARGE;
 codes.ERR_IPC_CHANNEL_CLOSED = ERR_IPC_CHANNEL_CLOSED;
 codes.ERR_METHOD_NOT_IMPLEMENTED = ERR_METHOD_NOT_IMPLEMENTED;
 codes.ERR_INVALID_RETURN_VALUE = ERR_INVALID_RETURN_VALUE;

filename: tests/unit_node/zlib_test.ts
patch: @@ -2,6 +2,7 @@
 
 import { assert, assertEquals, assertThrows } from "@std/assert";
 import { fromFileUrl, relative } from "@std/path";
+import { randomBytes } from "node:crypto";
 import {
   BrotliCompress,
   brotliCompress,
@@ -14,6 +15,7 @@ import {
   createBrotliCompress,
   createBrotliDecompress,
   createDeflate,
+  deflateSync,
   gzip,
   gzipSync,
   unzipSync,
@@ -273,3 +275,14 @@ Deno.test("BrotliCompress", async () => {
   await deffered.promise;
   assertEquals(data, "hello");
 });
+
+Deno.test("ERR_BUFFER_TOO_LARGE works correctly", () => {
+  assertThrows(
+    () => {
+      deflateSync(randomBytes(1024), {
+        maxOutputLength: 1,
+      });
+    },
+    "Cannot create a Buffer larger than 1 bytes",
+  );
+});
Repository: electron/electron
Pull request: perf: avoid 3x call to `GetID()` in RegisterPendingSiteInstance()

Backport of #46339

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/electron_browser_client.cc
patch: @@ -446,13 +446,13 @@ void ElectronBrowserClient::RegisterPendingSiteInstance(
     content::SiteInstance* pending_site_instance) {
   // Remember the original web contents for the pending renderer process.
   auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
-  auto* pending_process = pending_site_instance->GetProcess();
-  pending_processes_[pending_process->GetID()] = web_contents;
+  const auto pending_process_id = pending_site_instance->GetProcess()->GetID();
+  pending_processes_[pending_process_id] = web_contents;
 
   if (rfh->GetParent())
-    renderer_is_subframe_.insert(pending_process->GetID());
+    renderer_is_subframe_.insert(pending_process_id);
   else
-    renderer_is_subframe_.erase(pending_process->GetID());
+    renderer_is_subframe_.erase(pending_process_id);
 }
 
 void ElectronBrowserClient::AppendExtraCommandLineSwitches(
Repository: ollama/ollama
Pull request: length check for parameters


Changed files:
filename: parser/parser.go
patch: @@ -45,6 +45,10 @@ func Parse(reader io.Reader) ([]Command, error) {
 			command.Args = string(fields[1])
 		case "PARAMETER":
 			fields = bytes.SplitN(fields[1], []byte(" "), 2)
+			if len(fields) < 2 {
+				return nil, fmt.Errorf("missing value for %s", fields)
+			}
+
 			command.Name = string(fields[0])
 			command.Args = string(fields[1])
 		default:
Repository: ollama/ollama
Pull request: cmd: check GetBlobsPath error

The error returned by `server.GetBlobsPath` in `showLayer` was never checked. Check the error and return if not nil. Also, make newlines at the end of error messages consistent and fix a typo.

Changed files:
filename: cmd/cmd.go
patch: @@ -318,12 +318,16 @@ func generate(cmd *cobra.Command, model, prompt string) error {
 
 func showLayer(l *server.Layer) {
 	filename, err := server.GetBlobsPath(l.Digest)
+	if err != nil {
+		fmt.Println("Couldn't get layer's path")
+		return
+	}
 	bts, err := os.ReadFile(filename)
 	if err != nil {
-		fmt.Printf("Couldn't read layer")
+		fmt.Println("Couldn't read layer")
 		return
 	}
-	fmt.Printf(string(bts) + "\n")
+	fmt.Println(string(bts))
 }
 
 func generateInteractive(cmd *cobra.Command, model string) error {
@@ -460,7 +464,7 @@ func generateInteractive(cmd *cobra.Command, model string) error {
 				mp := server.ParseModelPath(model)
 				manifest, err := server.GetManifest(mp)
 				if err != nil {
-					fmt.Printf("error: couldn't get a manifestfor this model")
+					fmt.Println("error: couldn't get a manifest for this model")
 					continue
 				}
 				switch args[1] {
Repository: vercel/next.js
Pull request: Turbopack: increase time before persisting

### What?

Decrease the frequency of persisting since this is very expensive.

Closes PACK-5220

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
patch: @@ -2124,8 +2124,8 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
                 let last_snapshot = self.last_snapshot.load(Ordering::Relaxed);
                 let mut last_snapshot = self.start_time + Duration::from_millis(last_snapshot);
                 loop {
-                    const FIRST_SNAPSHOT_WAIT: Duration = Duration::from_secs(60);
-                    const SNAPSHOT_INTERVAL: Duration = Duration::from_secs(30);
+                    const FIRST_SNAPSHOT_WAIT: Duration = Duration::from_secs(300);
+                    const SNAPSHOT_INTERVAL: Duration = Duration::from_secs(120);
                     const IDLE_TIMEOUT: Duration = Duration::from_secs(2);
 
                     let time = if id == BACKEND_JOB_INITIAL_SNAPSHOT {
Repository: ggml-org/llama.cpp
Pull request: server : dynamic token limit for prompt cache

ref https://github.com/ggml-org/llama.cpp/pull/16391#issuecomment-3395815351

Increase the token limit of the prompt cache if it can fit in the specified memory limit.

Changed files:
filename: tools/server/server.cpp
patch: @@ -1585,23 +1585,31 @@ struct server_prompt_cache {
             }
         }
 
+        // average size per token
+        const float size_per_token = std::max<float>(1.0f, float(size()) / (std::max<size_t>(1, n_tokens())));
+
+        // dynamically increase the token limit if it can fit in the memory limit
+        const size_t limit_tokens_cur = limit_size > 0 ? std::max<size_t>(limit_tokens, limit_size/size_per_token) : limit_tokens;
+
         if (limit_tokens > 0) {
-            while (states.size() > 1 && n_tokens() > limit_tokens) {
+            while (states.size() > 1 && n_tokens() > limit_tokens_cur) {
                 if (states.empty()) {
                     break;
                 }
 
-                SRV_WRN(" - cache token limit reached, removing oldest entry (size = %.3f MiB)\n", states.front().size() / (1024.0 * 1024.0));
+                SRV_WRN(" - cache token limit (%zu, est: %zu) reached, removing oldest entry (size = %.3f MiB)\n",
+                        limit_tokens, limit_tokens_cur, states.front().size() / (1024.0 * 1024.0));
 
                 states.pop_front();
             }
         }
 
-        SRV_WRN(" - cache state: %zu prompts, %.3f MiB (limits: %.3f MiB, %zu tokens)\n",
-                states.size(), size() / (1024.0 * 1024.0), limit_size / (1024.0 * 1024.0), limit_tokens);
+        SRV_WRN(" - cache state: %zu prompts, %.3f MiB (limits: %.3f MiB, %zu tokens, %zu est)\n",
+                states.size(), size() / (1024.0 * 1024.0), limit_size / (1024.0 * 1024.0), limit_tokens, limit_tokens_cur);
 
         for (const auto & state : states) {
-            SRV_WRN("   - prompt %p: %7d tokens, checkpoints: %2zu, %9.3f MiB\n", (const void *)&state, state.n_tokens(), state.checkpoints.size(), state.size() / (1024.0 * 1024.0));
+            SRV_WRN("   - prompt %p: %7d tokens, checkpoints: %2zu, %9.3f MiB\n",
+                    (const void *)&state, state.n_tokens(), state.checkpoints.size(), state.size() / (1024.0 * 1024.0));
         }
     }
 };
Repository: electron/electron
Pull request: perf: avoid 3x call to `GetID()` in RegisterPendingSiteInstance()

#### Description of Change

Don't call virtual method `RenderProcessHost::GetID()` three times in a row when one time will do.

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none.

Changed files:
filename: shell/browser/electron_browser_client.cc
patch: @@ -446,13 +446,13 @@ void ElectronBrowserClient::RegisterPendingSiteInstance(
     content::SiteInstance* pending_site_instance) {
   // Remember the original web contents for the pending renderer process.
   auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
-  auto* pending_process = pending_site_instance->GetProcess();
-  pending_processes_[pending_process->GetID()] = web_contents;
+  const auto pending_process_id = pending_site_instance->GetProcess()->GetID();
+  pending_processes_[pending_process_id] = web_contents;
 
   if (rfh->GetParent())
-    renderer_is_subframe_.insert(pending_process->GetID());
+    renderer_is_subframe_.insert(pending_process_id);
   else
-    renderer_is_subframe_.erase(pending_process->GetID());
+    renderer_is_subframe_.erase(pending_process_id);
 }
 
 void ElectronBrowserClient::AppendExtraCommandLineSwitches(