helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: Fix in the example in examples/retrieval

Quick fix in the retrieval example so that only at most n_seq_max chunks of
text are added to the llama_batch and this example stop crashing due attempting
to process more token sequences in a batch than allocated by llama_context::
encode and llama_context::decode.

The retrieval example crashes because (according to my understanding of the llama_context code) llama_context::encode is going to allocate n_seq_max sequences of tokens, and the loop in the example keeps adding more sequences. I added a condition so that the loop stops adding tokens when s reaches llama_n_seq_max(ctx).

Changed files:
filename: examples/retrieval/retrieval.cpp
patch: @@ -222,16 +222,16 @@ int main(int argc, char ** argv) {
     float * emb = embeddings.data();
 
     // break into batches
-    int p = 0; // number of prompts processed already
-    int s = 0; // number of prompts in current batch
+    unsigned int p = 0; // number of prompts processed already
+    unsigned int s = 0; // number of prompts in current batch
     for (int k = 0; k < n_chunks; k++) {
         // clamp to n_batch tokens
         auto & inp = chunks[k].tokens;
 
         const uint64_t n_toks = inp.size();
 
         // encode if at capacity
-        if (batch.n_tokens + n_toks > n_batch) {
+        if (batch.n_tokens + n_toks > n_batch || s >= llama_n_seq_max(ctx)) {
             float * out = emb + p * n_embd;
             batch_process(ctx, batch, out, s, n_embd);
             common_batch_clear(batch);
Repository: vercel/next.js
Pull request: Stop manually setting stacktrace limit

Ignore-listing will take care of removing irrelevant stacks. And if you do need the stacks, you can just disable them in a debugger (or upcoming CLI flag). It's also future proof in case this code ever gets refactored to something callable from user code. Forcing no stacks helps nobody since it adds square brackets around logged errors.

Before:
```
[Error: Fatal next config errors found in next.config.js that must be fixed:
    Unrecognized key(s) in object: 'turbopackPersistentCachingForDev', 'devtoolSegmentExplorer' at "experimental"
    Use 'experimental.turbopackFileSystemCacheForDev' instead.
    Learn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackFileSystemCache
These configuration options are required or have been migrated. Please update your configuration.
See more info here: https://nextjs.org/docs/messages/invalid-next-config]
```

After:
```
Error: Fatal next config errors found in next.config.js that must be fixed:
    Unrecognized key(s) in object: 'turbopackPersistentCachingForDev', 'devtoolSegmentExplorer' at "experimental"
    Use 'experimental.turbopackFileSystemCacheForDev' instead.
    Learn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackFileSystemCache
These configuration options are required or have been migrated. Please update your configuration.
See more info here: https://nextjs.org/docs/messages/invalid-next-config
    at ignore-listed frames
```


Changed files:
filename: packages/next/src/server/config.ts
patch: @@ -1971,18 +1971,7 @@ async function validateConfigSchema(
       }
 
       const fullErrorMessage = errorMessages.join('\n')
-
-      let err: Error
-      // Hide the stack trace for this error as the trace is not useful here.
-      const stackTraceLimit = Error.stackTraceLimit
-      Error.stackTraceLimit = 0
-      try {
-        err = new Error(fullErrorMessage)
-      } finally {
-        Error.stackTraceLimit = stackTraceLimit
-      }
-
-      throw err
+      throw new Error(fullErrorMessage)
     }
   }
 }
Repository: ggml-org/llama.cpp
Pull request: common: fix return value check for setpriority

On macOS and POSIX systems, a return value of 0 from `getpriority()` indicates success. 
```
RETURN VALUES
     Since getpriority() can legitimately return the value -1, it is necessary to clear the external variable errno prior to
     the call, then check it afterward to determine if a -1 is an error or a legitimate value.  The setpriority() call returns
     0 if there is no error, or -1 if there is.
```
The `!` operator in the code should be removed.

https://github.com/ggml-org/llama.cpp/blob/06705fdcb3ef199d2c2c95a5e3cbb7cf9cc5256e/common/common.cpp#L254-L257

Additionally, the Windows version's logic for `SetPriorityClass` is correct, [since it returns 0 to indicate failure](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setpriorityclass#return-value).

https://github.com/ggml-org/llama.cpp/blob/06705fdcb3ef199d2c2c95a5e3cbb7cf9cc5256e/common/common.cpp#L228-L231

Changed files:
filename: common/common.cpp
patch: @@ -251,7 +251,7 @@ bool set_process_priority(enum ggml_sched_priority prio) {
         case GGML_SCHED_PRIO_REALTIME: p = -20; break;
     }
 
-    if (!setpriority(PRIO_PROCESS, 0, p)) {
+    if (setpriority(PRIO_PROCESS, 0, p) != 0) {
         LOG_WRN("failed to set process priority %d : %s (%d)\n", prio, strerror(errno), errno);
         return false;
     }

filename: tools/completion/completion.cpp
patch: @@ -175,7 +175,10 @@ int main(int argc, char ** argv) {
     struct ggml_threadpool_params tpp =
             ggml_threadpool_params_from_cpu_params(params.cpuparams);
 
-    set_process_priority(params.cpuparams.priority);
+    if (!set_process_priority(params.cpuparams.priority)) {
+        LOG_ERR("%s: error: failed to set process priority\n", __func__);
+        return 1;
+    }
 
     struct ggml_threadpool * threadpool_batch = NULL;
     if (!ggml_threadpool_params_match(&tpp, &tpp_batch)) {

filename: tools/llama-bench/llama-bench.cpp
patch: @@ -2037,7 +2037,10 @@ int main(int argc, char ** argv) {
     llama_backend_init();
     llama_numa_init(params.numa);
 
-    set_process_priority(params.prio);
+    if (!set_process_priority(params.prio)) {
+        fprintf(stderr, "%s: error: failed to set process priority\n", __func__);
+        return 1;
+    }
 
     // initialize printer
     std::unique_ptr<printer> p     = create_printer(params.output_format);
Repository: facebook/react
Pull request: [Fizz] Include componentStack at the root when aborting

When aborting we currently don't produce a componentStack when aborting the shell. This is likely just an oversight and this change updates this behavior to be consistent with what we do when there is a boundary

Changed files:
filename: packages/react-server/src/ReactFizzServer.js
patch: @@ -3870,8 +3870,9 @@ function abortTask(task: Task, request: Request, error: mixed): void {
     segment.status = ABORTED;
   }
 
+  const errorInfo = getThrownInfo(task.componentStack);
+
   if (boundary === null) {
-    const errorInfo: ThrownInfo = {};
     if (request.status !== CLOSING && request.status !== CLOSED) {
       const replay: null | ReplaySet = task.replay;
       if (replay === null) {
@@ -3957,7 +3958,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
     boundary.pendingTasks--;
     // We construct an errorInfo from the boundary's componentStack so the error in dev will indicate which
     // boundary the message is referring to
-    const errorInfo = getThrownInfo(task.componentStack);
     const trackedPostpones = request.trackedPostpones;
     if (boundary.status !== CLIENT_RENDERED) {
       if (enableHalt) {
Repository: ollama/ollama
Pull request: Fix OpenAI `finish_reason` values when empty

Fixes https://github.com/ollama/ollama/issues/4357

Changed files:
filename: openai/openai.go
patch: @@ -107,9 +107,14 @@ func toChatCompletion(id string, r api.ChatResponse) ChatCompletion {
 		Model:             r.Model,
 		SystemFingerprint: "fp_ollama",
 		Choices: []Choice{{
-			Index:        0,
-			Message:      Message{Role: r.Message.Role, Content: r.Message.Content},
-			FinishReason: &r.DoneReason,
+			Index:   0,
+			Message: Message{Role: r.Message.Role, Content: r.Message.Content},
+			FinishReason: func(reason string) *string {
+				if len(reason) > 0 {
+					return &reason
+				}
+				return nil
+			}(r.DoneReason),
 		}},
 		Usage: Usage{
 			// TODO: ollama returns 0 for prompt eval if the prompt was cached, but openai returns the actual count
@@ -127,13 +132,16 @@ func toChunk(id string, r api.ChatResponse) ChatCompletionChunk {
 		Created:           time.Now().Unix(),
 		Model:             r.Model,
 		SystemFingerprint: "fp_ollama",
-		Choices: []ChunkChoice{
-			{
-				Index:        0,
-				Delta:        Message{Role: "assistant", Content: r.Message.Content},
-				FinishReason: &r.DoneReason,
-			},
-		},
+		Choices: []ChunkChoice{{
+			Index: 0,
+			Delta: Message{Role: "assistant", Content: r.Message.Content},
+			FinishReason: func(reason string) *string {
+				if len(reason) > 0 {
+					return &reason
+				}
+				return nil
+			}(r.DoneReason),
+		}},
 	}
 }
Repository: facebook/react
Pull request: Update react-native/react-dom build directory

Commit artifact actions are breaking after https://github.com/facebook/react/pull/30711

See: https://github.com/facebook/react/actions/runs/10930658977/job/30344033974

> mv: cannot stat 'build/facebook-react-native/react/dom/': No such file or directory

After build, the new artifacts are in `/react-dom/cjs`, not `/react/dom/`
```
$> yarn build
$> ls build/facebook-react-native/react/
# ... no dom
$> ls build/facebook-react-native/react-dom/cjs
```

Changed files:
filename: .github/workflows/runtime_commit_artifacts.yml
patch: @@ -125,7 +125,7 @@ jobs:
           mv build/react-native/shims/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
           mv build/facebook-react-native/scheduler/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/scheduler/
           mv build/facebook-react-native/react/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react/
-          mv build/facebook-react-native/react/dom/ $BASE_FOLDER/RKJSModules/vendor/react/react-dom/
+          mv build/facebook-react-native/react-dom/cjs $BASE_FOLDER/RKJSModules/vendor/react/react-dom/
           mv build/facebook-react-native/react-is/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-is/
           mv build/facebook-react-native/react-test-renderer/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-test-renderer/
Repository: vercel/next.js
Pull request: Turbopack: fix spacing on EcmascriptModuleAssetType

### What?

typo

Closes PACK-5686

Changed files:
filename: turbopack/crates/turbopack-ecmascript/src/lib.rs
patch: @@ -300,10 +300,10 @@ impl Display for EcmascriptModuleAssetType {
             EcmascriptModuleAssetType::Typescript { tsx, analyze_types } => {
                 write!(f, "typescript")?;
                 if *tsx {
-                    write!(f, "with JSX")?;
+                    write!(f, " with JSX")?;
                 }
                 if *analyze_types {
-                    write!(f, "with types")?;
+                    write!(f, " with types")?;
                 }
                 Ok(())
             }
Repository: ollama/ollama
Pull request: case sensitive filepaths

TODO: filenames can be case sensitive but filepaths should not. however this needs to be backwards compatible. it currently is not so fix the regression first

resolves #4346 

Changed files:
filename: types/model/name.go
patch: @@ -291,11 +291,9 @@ func (n Name) Filepath() string {
 		panic("illegal attempt to get filepath of invalid name")
 	}
 	return filepath.Join(
-		strings.ToLower(filepath.Join(
-			n.Host,
-			n.Namespace,
-			n.Model,
-		)),
+		n.Host,
+		n.Namespace,
+		n.Model,
 		n.Tag,
 	)
 }

filename: types/model/name_test.go
patch: @@ -276,9 +276,9 @@ func TestFilepathAllocs(t *testing.T) {
 	allocs := testing.AllocsPerRun(1000, func() {
 		n.Filepath()
 	})
-	var allowedAllocs float64 = 3
+	var allowedAllocs float64 = 1
 	if runtime.GOOS == "windows" {
-		allowedAllocs = 5
+		allowedAllocs = 3
 	}
 	if allocs > allowedAllocs {
 		t.Errorf("allocs = %v; allowed %v", allocs, allowedAllocs)
Repository: ggml-org/llama.cpp
Pull request: ci: re-enable rocm build on amd64

This was disabled in #9340 due to a compiler crash, but seems to build now as confirmed by the latest comments in #11913.

I've also to built the image with `docker build -f .devops/rocm.Dockerfile .` (for all three stages, `full`, `server` and `light`).

A quick attempt at trying to build an arm64 image failed. Since none of the other images are built for arm, I only enabled the amd64 one.

The `runs_on` option was added to match the other entries.

I don't know if there's an easy way to do a test build on CI, or if we just need to submit this PR and wait for the next scheduled build.

Changed files:
filename: .github/workflows/docker.yml
patch: @@ -45,8 +45,7 @@ jobs:
           - { tag: "intel",  dockerfile: ".devops/intel.Dockerfile",  platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true,  runs_on: "ubuntu-22.04" }
           - { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
           - { tag: "s390x",  dockerfile: ".devops/s390x.Dockerfile",  platforms: "linux/s390x", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04-s390x" }
-          # Note: the rocm images are failing due to a compiler error and are disabled until this is fixed to allow the workflow to complete
-          #- {tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true, free_disk_space: true }
+          - { tag: "rocm",   dockerfile: ".devops/rocm.Dockerfile",   platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true,  runs_on: "ubuntu-22.04" }
     steps:
       - name: Check out the repo
         uses: actions/checkout@v4
Repository: facebook/react
Pull request: [lint] Add no-optional-chaining

## Overview

Adds a lint rule to prevent optional chaining to catch issues like https://github.com/facebook/react/pull/30982 until we support optional chaining without a bundle impact.

Changed files:
filename: .eslintrc.js
patch: @@ -23,6 +23,7 @@ module.exports = {
     'babel',
     'ft-flow',
     'jest',
+    'es',
     'no-for-of-loops',
     'no-function-declare-after-return',
     'react',
@@ -47,7 +48,7 @@ module.exports = {
     'ft-flow/no-unused-expressions': ERROR,
     // 'ft-flow/no-weak-types': WARNING,
     // 'ft-flow/require-valid-file-annotation': ERROR,
-
+    'es/no-optional-chaining': ERROR,
     'no-cond-assign': OFF,
     'no-constant-condition': OFF,
     'no-control-regex': OFF,
@@ -435,6 +436,7 @@ module.exports = {
         'packages/react-dom/src/test-utils/*.js',
       ],
       rules: {
+        'es/no-optional-chaining': OFF,
         'react-internal/no-production-logging': OFF,
         'react-internal/warning-args': OFF,
         'react-internal/safe-string-coercion': [

filename: package.json
patch: @@ -54,6 +54,7 @@
     "eslint": "^7.7.0",
     "eslint-config-prettier": "^6.9.0",
     "eslint-plugin-babel": "^5.3.0",
+    "eslint-plugin-es": "^4.1.0",
     "eslint-plugin-eslint-plugin": "^3.5.3",
     "eslint-plugin-ft-flow": "^2.0.3",
     "eslint-plugin-jest": "28.4.0",

filename: packages/react-debug-tools/src/ReactDebugHooks.js
patch: @@ -567,8 +567,9 @@ function useMemoCache(size: number): Array<any> {
     return [];
   }
 
-  // $FlowFixMe[incompatible-use]: updateQueue is mixed
-  const memoCache = fiber.updateQueue?.memoCache;
+  const memoCache =
+    // $FlowFixMe[incompatible-use]: updateQueue is mixed
+    fiber.updateQueue != null ? fiber.updateQueue.memoCache : null;
   if (memoCache == null) {
     return [];
   }

filename: yarn.lock
patch: @@ -7262,6 +7262,14 @@ eslint-plugin-babel@^5.3.0:
   dependencies:
     eslint-rule-composer "^0.3.0"
 
+eslint-plugin-es@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9"
+  integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==
+  dependencies:
+    eslint-utils "^2.0.0"
+    regexpp "^3.0.0"
+
 eslint-plugin-eslint-plugin@^3.5.3:
   version "3.5.3"
   resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-3.5.3.tgz#6cac958e944b820962a4cf9e65cc32a2e0415eaf"
@@ -13971,7 +13979,7 @@ regex-not@^1.0.0, regex-not@^1.0.2:
     extend-shallow "^3.0.2"
     safe-regex "^1.1.0"
 
-regexpp@^3.1.0:
+regexpp@^3.0.0, regexpp@^3.1.0:
   version "3.2.0"
   resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
   integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
Repository: electron/electron
Pull request: fix: dialog file filters and macOS app bundles

Backport of #47825

See that PR for details.


Notes: Fixed a bug where `app` extensions filters didn't allow for selecting app bundles in macOS file dialogs.

Changed files:
filename: shell/browser/ui/file_dialog_mac.mm
patch: @@ -122,6 +122,18 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
       if (ext == "*") {
         [content_types_set addObject:[UTType typeWithFilenameExtension:@"*"]];
         break;
+      } else if (ext == "app") {
+        // This handles a bug on macOS where the "app" extension by default
+        // maps to "com.apple.application-file", which is for an Application
+        // file (older single-file carbon based apps), and not modern
+        // Application Bundles (multi file packages as you'd see for all modern
+        // applications).
+        UTType* superType =
+            [UTType typeWithIdentifier:@"com.apple.application-bundle"];
+        if (UTType* utt = [UTType typeWithFilenameExtension:@"app"
+                                           conformingToType:superType]) {
+          [content_types_set addObject:utt];
+        }
       } else {
         if (UTType* utt = [UTType typeWithFilenameExtension:@(ext.c_str())])
           [content_types_set addObject:utt];
Repository: vercel/next.js
Pull request: Turbopack: respect `--profile` CLI param

Previously, `next build --profile` wasn't doing anything, it was still using the non-profiling React build.

Specifying it in next.config.js was already working. But we didn't copy over the CLI flag into `config. reactProductionProfiling` for Turbopack.

Closes PACK-5693

Changed files:
filename: packages/next/src/build/turbopack-build/impl.ts
patch: @@ -220,7 +220,10 @@ export async function workerMain(workerData: {
   NextBuildContext.config = await loadConfig(
     PHASE_PRODUCTION_BUILD,
     NextBuildContext.dir!,
-    { debugPrerender: NextBuildContext.debugPrerender }
+    {
+      debugPrerender: NextBuildContext.debugPrerender,
+      reactProductionProfiling: NextBuildContext.reactProductionProfiling,
+    }
   )
 
   // Matches handling in build/index.ts

filename: packages/next/src/build/webpack-build/impl.ts
patch: @@ -386,7 +386,10 @@ export async function workerMain(workerData: {
   NextBuildContext.config = await loadConfig(
     PHASE_PRODUCTION_BUILD,
     NextBuildContext.dir!,
-    { debugPrerender: NextBuildContext.debugPrerender }
+    {
+      debugPrerender: NextBuildContext.debugPrerender,
+      reactProductionProfiling: NextBuildContext.reactProductionProfiling,
+    }
   )
   NextBuildContext.nextBuildSpan = trace(
     `worker-main-${workerData.compilerName}`
Repository: ggml-org/llama.cpp
Pull request: cuda: fix race condition in cumsum


Changed files:
filename: ggml/src/ggml-cuda/cumsum.cu
patch: @@ -61,19 +61,20 @@ static __global__ void cumsum_cub_kernel(
 
         // Add offset to each item and store
         T thread_offset = thread_prefix - thread_sum + block_carry;
-        #pragma unroll
+#pragma unroll
         for (int i = 0; i < UNROLL_FACTOR; i++) {
             int64_t idx = start + tid * UNROLL_FACTOR + i;
             if (idx < ne00) {
                 dst_row[idx] = items[i] + thread_offset;
             }
         }
 
+        __syncthreads();
+
         // Update carry for next tile
         if (tid == 0) {
             block_carry += block_total;
         }
-        __syncthreads();
     }
 #else
     NO_DEVICE_CODE;
@@ -175,11 +176,12 @@ static __global__ void cumsum_kernel(
             }
         }
 
+        __syncthreads();
+
         // Update carry for next chunk
         if (tid == 0) {
             *s_carry += *s_chunk_total;
         }
-        __syncthreads();
     }
 }
Repository: huggingface/transformers
Pull request: Remove invalid `@staticmethod` from module-level get_device_and_memory_breakdown

Remove invalid staticmethod decorator from module-level function `get_device_and_memory_breakdown`.

This PR removes an incorrect @staticmethod decorator applied to the module-level function `get_device_and_memory_breakdown`.

The decorator caused a runtime error on Python 3.9, even though it appeared to work fine on newer Python versions.

See `trl` stacktrace for Python 3.9: https://github.com/huggingface/trl/actions/runs/18605452485/job/53053774127
```python
ERROR    ContinuousBatchingLogger:continuous_api.py:879 Error in generation loop: 'staticmethod' object is not callable
Traceback (most recent call last):
  File "/__w/trl/trl/.venv/lib/python3.9/site-packages/transformers/generation/continuous_batching/continuous_api.py", line 837, in _run_generation_loop
    paged_attention_cache = PagedAttentionCache(
  File "/__w/trl/trl/.venv/lib/python3.9/site-packages/transformers/generation/continuous_batching/cache.py", line 191, in __init__
    num_blocks, max_batch_tokens = memory_handler.infer_num_blocks_and_max_batch_tokens(
  File "/__w/trl/trl/.venv/lib/python3.9/site-packages/transformers/generation/continuous_batching/cache.py", line 437, in infer_num_blocks_and_max_batch_tokens
    num_blocks, max_batch_tokens = self.compute_num_blocks_and_max_batch_tokens(
  File "/__w/trl/trl/.venv/lib/python3.9/site-packages/transformers/generation/continuous_batching/cache.py", line 476, in compute_num_blocks_and_max_batch_tokens
    cache_memory = self.get_available_memory(max_memory_percent)
  File "/__w/trl/trl/.venv/lib/python3.9/site-packages/transformers/generation/continuous_batching/cache.py", line 411, in get_available_memory
    _, total, reserved, allocated = get_device_and_memory_breakdown()
TypeError: 'staticmethod' object is not callable
```

### Root cause
In Python 3.9 and earlier, `@staticmethod` produces a descriptor object that is not directly callable when defined outside a class.

Starting with Python 3.10, CPython changed the behavior of `staticmethod`: staticmethod objects gained a `__call__` method that delegates to the wrapped function, making them callable even outside a class context. However, this masked the underlying issue in newer Python versions.

### Fix
Remove the invalid decorator and leave the function as a normal callable at module scope.

This PR will fix https://github.com/huggingface/trl/issues/4308

CC: @remi-or, who created the original PR:
- https://github.com/huggingface/transformers/pull/40426

Changed files:
filename: src/transformers/generation/continuous_batching/requests.py
patch: @@ -27,7 +27,6 @@
 logger = logging.getLogger("ContinuousBatchingLogger")
 
 
-@staticmethod
 def get_device_and_memory_breakdown() -> tuple[torch.device, int, int, int]:
     if torch.cuda.is_available():
         device = torch.device("cuda")