helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: remove unused


Changed files:
filename: server/auth.go
patch: @@ -71,7 +71,7 @@ func (r AuthRedirect) URL() (*url.URL, error) {
 	return redirectURL, nil
 }
 
-func getAuthToken(ctx context.Context, redirData AuthRedirect, regOpts *RegistryOptions) (string, error) {
+func getAuthToken(ctx context.Context, redirData AuthRedirect) (string, error) {
 	redirectURL, err := redirData.URL()
 	if err != nil {
 		return "", err

filename: server/images.go
patch: @@ -1394,7 +1394,7 @@ func makeRequestWithRetry(ctx context.Context, method string, requestURL *url.UR
 		case resp.StatusCode == http.StatusUnauthorized:
 			auth := resp.Header.Get("www-authenticate")
 			authRedir := ParseAuthRedirectString(auth)
-			token, err := getAuthToken(ctx, authRedir, regOpts)
+			token, err := getAuthToken(ctx, authRedir)
 			if err != nil {
 				return nil, err
 			}

filename: server/upload.go
patch: @@ -125,7 +125,7 @@ func uploadBlobChunked(ctx context.Context, requestURL *url.URL, layer *Layer, r
 
 				auth := resp.Header.Get("www-authenticate")
 				authRedir := ParseAuthRedirectString(auth)
-				token, err := getAuthToken(ctx, authRedir, regOpts)
+				token, err := getAuthToken(ctx, authRedir)
 				if err != nil {
 					return err
 				}
Repository: electron/electron
Pull request: perf: avoid redundant map lookup in UsbChooserContext::OnDeviceRemoved()

Backport of #46387

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/usb/usb_chooser_context.cc
patch: @@ -302,8 +302,8 @@ void UsbChooserContext::OnDeviceRemoved(
   }
 
   // Update the device list.
-  DCHECK(devices_.contains(device_info->guid));
-  devices_.erase(device_info->guid);
+  const size_t n_erased = devices_.erase(device_info->guid);
+  DCHECK_EQ(n_erased, 1U);
 
   // Notify all device observers.
   for (auto& observer : device_observer_list_)
Repository: nodejs/node
Pull request: src: use String::WriteV2() in TwoByteValue

Since `String::Write()` is deprecated, use `String::WriteV2()` instead.

<!--
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: src/util.cc
patch: @@ -146,12 +146,10 @@ TwoByteValue::TwoByteValue(Isolate* isolate, Local<Value> value) {
   Local<String> string;
   if (!value->ToString(isolate->GetCurrentContext()).ToLocal(&string)) return;
 
-  // Allocate enough space to include the null terminator
-  const size_t storage = string->Length() + 1;
-  AllocateSufficientStorage(storage);
-
-  const int flags = String::NO_NULL_TERMINATION;
-  const int length = string->Write(isolate, out(), 0, storage, flags);
+  // Allocate enough space to include the null terminator.
+  const size_t length = string->Length();
+  AllocateSufficientStorage(length + 1);
+  string->WriteV2(isolate, 0, length, out());
   SetLengthAndZeroTerminate(length);
 }
Repository: ollama/ollama
Pull request: update docker image


Changed files:
filename: Dockerfile
patch: @@ -1,10 +1,13 @@
 FROM golang:alpine
 
+ARG VERSION=0.0.0
+
 WORKDIR /go/src/github.com/jmorganca/ollama
 RUN apk add --no-cache git build-base cmake
 
 COPY . .
-RUN go generate ./... && go build -ldflags '-linkmode external -extldflags "-static"' .
+RUN go generate ./... \
+    && go build -ldflags "-linkmode=external -extldflags='-static' -X=github.com/jmorganca/ollama/version.Version=$VERSION -X=github.com/jmorganca/ollama/server.mode=release" .
 
 FROM alpine
 ENV OLLAMA_HOST 0.0.0.0

filename: Dockerfile.cuda
patch: @@ -1,12 +1,17 @@
 FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
 
+ARG TARGETARCH
+ARG VERSION=0.0.0
+
 WORKDIR /go/src/github.com/jmorganca/ollama
 RUN apt-get update && apt-get install -y git build-essential cmake
-ADD https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz /tmp/go1.21.1.tar.gz
+ADD https://dl.google.com/go/go1.21.1.linux-$TARGETARCH.tar.gz /tmp/go1.21.1.tar.gz
 RUN mkdir -p /usr/local && tar xz -C /usr/local </tmp/go1.21.1.tar.gz
 
 COPY . .
-RUN /usr/local/go/bin/go generate ./... && /usr/local/go/bin/go build -ldflags '-linkmode external -extldflags "-static"' .
+ENV GOARCH=$TARGETARCH
+RUN /usr/local/go/bin/go generate ./... \
+    && /usr/local/go/bin/go build -ldflags "-linkmode=external -extldflags='-static' -X=github.com/jmorganca/ollama/version.Version=$VERSION -X=github.com/jmorganca/ollama/server.mode=release" .
 
 FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04
 ENV OLLAMA_HOST 0.0.0.0
Repository: facebook/react
Pull request: Add useActionState to CHANGELOG-canary.md


Changed files:
filename: CHANGELOG-canary.md
patch: @@ -1,3 +1,8 @@
+## March 22, 2024 (18.3.0-canary-670811593-20240322)
+
+## React
+- Added `useActionState` to replace `useFormState` and added `pending` value ([#28491](https://github.com/facebook/react/pull/28491)).
+
 ## October 5, 2023 (18.3.0-canary-546178f91-20231005)
 
 ### React
Repository: ggml-org/llama.cpp
Pull request: llama-batch: fix build fails with `-Werror=missing-braces`

## Why it failed

When compiling with strict compiler flags (-Wmissing-braces -Werror=missing-braces), the build fails with the following error:

```
cmake \
  -S . \
  -B ../llama.cpp.build \
  --preset=x64-linux-gcc-debug \
  -DCMAKE_INSTALL_PREFIX=/tmp/local \
  -DCMAKE_CXX_FLAGS="-Wmissing-braces -Werror=missing-braces" && \
cmake --build ../llama.cpp.build/
...
In file included from /home/otegami/work/cpp/llama.cpp/src/llama-graph.h:4,
                 from /home/otegami/work/cpp/llama.cpp/src/llama-model.h:5,
                 from /home/otegami/work/cpp/llama.cpp/src/llama.cpp:8:
/home/otegami/work/cpp/llama.cpp/src/llama-batch.h:126:48: error: missing braces around initializer for 'std::__array_traits<int, 1>::_Type' {aka 'int [1]'} [-Werror=missing-braces]
  126 |     std::array<llama_seq_id, 1> seq_id_0 = { 0 }; // default sequence id
      |                                                ^
cc1plus: some warnings being treated as errors
```

The issue is that std::array initialization requires double braces.

## How to fix

This PR changes `{ 0 }` to `{{ 0 }}` for std::array initialization.

This is part of a series of commits to fix missing braces warnings across the codebase.
- src/llama-batch.h <- This PR is here.
- src/llama-context.cpp
- tests/test-backend-ops.cpp
- tests/test-gguf.cpp
- tools/mtmd/clip.cpp

Benefits:
- std::array is a struct containing a C-style array, requiring nested braces
- Enables stricter compiler warnings to catch potential issues

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*


Changed files:
filename: src/llama-batch.h
patch: @@ -123,7 +123,7 @@ class llama_batch_allocr {
     uint32_t n_seq_max;
     uint32_t n_outputs;
 
-    std::array<llama_seq_id, 1> seq_id_0 = { 0 }; // default sequence id
+    std::array<llama_seq_id, 1> seq_id_0 = {{ 0 }}; // default sequence id
 
     std::vector<llama_pos>      pos;
     std::vector<int32_t>        n_seq_id;
Repository: denoland/deno
Pull request: fix(install): don't try to re-symlink binaries in node_modules if the symlink is correct

Fix #30424.

I think this should avoid the errors. It will add some overhead when they aren't set up yet, but binaries are pretty small in number so I doubt it will matter.

In the case where it's already set up (which is probably common), it should avoid some work and prevent using binaries that are already in use

Changed files:
filename: libs/npm_installer/bin_entries.rs
patch: @@ -1,5 +1,6 @@
 // Copyright 2018-2025 the Deno authors. MIT license.
 
+use std::borrow::Cow;
 use std::collections::HashMap;
 use std::collections::HashSet;
 use std::collections::VecDeque;
@@ -16,6 +17,7 @@ use sys_traits::FsFileSetPermissions;
 use sys_traits::FsMetadata;
 use sys_traits::FsMetadataValue;
 use sys_traits::FsOpen;
+use sys_traits::FsReadLink;
 use sys_traits::FsRemoveFile;
 use sys_traits::FsSymlinkFile;
 use sys_traits::FsWrite;
@@ -363,7 +365,13 @@ fn sort_by_depth(
 
 #[sys_traits::auto_impl]
 pub trait SetupBinEntrySys:
-  FsOpen + FsWrite + FsSymlinkFile + FsRemoveFile + FsCreateDirAll + FsMetadata
+  FsOpen
+  + FsWrite
+  + FsSymlinkFile
+  + FsRemoveFile
+  + FsCreateDirAll
+  + FsMetadata
+  + FsReadLink
 {
 }
 
@@ -472,7 +480,7 @@ impl EntrySetupOutcome<'_> {
 }
 
 fn symlink_bin_entry<'a>(
-  sys: &(impl FsOpen + FsSymlinkFile + FsRemoveFile),
+  sys: &(impl FsOpen + FsSymlinkFile + FsRemoveFile + FsReadLink),
   package: &'a NpmResolutionPackage,
   extra: &'a NpmPackageExtraInfo,
   bin_name: &'a str,
@@ -487,6 +495,16 @@ fn symlink_bin_entry<'a>(
     pathdiff::diff_paths(to, from)
   }
 
+  let original_relative = relative_path(bin_node_modules_dir_path, &original)
+    .map(Cow::Owned)
+    .unwrap_or_else(|| Cow::Borrowed(&original));
+
+  if let Ok(original_link) = sys.fs_read_link(&link)
+    && *original_link == *original_relative
+  {
+    return Ok(EntrySetupOutcome::Success);
+  }
+
   let found = make_executable_if_exists(sys, &original).map_err(|source| {
     BinEntriesError::SetUpBin {
       name: bin_name.to_string(),
@@ -504,10 +522,7 @@ fn symlink_bin_entry<'a>(
     });
   }
 
-  let original_relative =
-    relative_path(bin_node_modules_dir_path, &original).unwrap_or(original);
-
-  if let Err(err) = sys.fs_symlink_file(&original_relative, &link) {
+  if let Err(err) = sys.fs_symlink_file(&*original_relative, &link) {
     if err.kind() == std::io::ErrorKind::AlreadyExists {
       // remove and retry
       sys.fs_remove_file(&link).map_err(|source| {
@@ -517,7 +532,7 @@ fn symlink_bin_entry<'a>(
         }
       })?;
       sys
-        .fs_symlink_file(&original_relative, &link)
+        .fs_symlink_file(&*original_relative, &link)
         .map_err(|source| BinEntriesError::SetUpBin {
           name: bin_name.to_string(),
           path: original_relative.to_path_buf(),
Repository: electron/electron
Pull request: perf: avoid redundant map lookup in UsbChooserContext::OnDeviceRemoved()

#### Description of Change

Avoid a redundant map lookup in `UsbChooserContext::OnDeviceRemoved()`.

All reviews welcomed. CC @codebytere who reviewed [this PR's sibling](https://github.com/electron/electron/pull/46343) :smile_cat: 

#### 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/usb/usb_chooser_context.cc
patch: @@ -302,8 +302,8 @@ void UsbChooserContext::OnDeviceRemoved(
   }
 
   // Update the device list.
-  DCHECK(devices_.contains(device_info->guid));
-  devices_.erase(device_info->guid);
+  const size_t n_erased = devices_.erase(device_info->guid);
+  DCHECK_EQ(n_erased, 1U);
 
   // Notify all device observers.
   for (auto& observer : device_observer_list_)
Repository: vercel/next.js
Pull request: fix: Combine the hrtime tuple to get a better seconds representation

When building w/ webpack to calculate duration, we use `process.hrtime` which is a tuple of integers [seconds, nanoseconds] - which means that for sub second compiler runs, we end up showing total 0ms, or 1000ms (I think)

- https://nodejs.org/api/process.html#processhrtimetime

With this PR we combine the seconds and nanoseconds into a float. 

### Before:

```console
   ▲ Next.js 15.4.6
   - Environments: .env.production

   Creating an optimized production build ...
 ✓ Compiled successfully in 0ms
   Skipping validation of types
```

### After

```console
   ▲ Next.js 15.4.6
   - Environments: .env.production

   Creating an optimized production build ...
 ✓ Compiled successfully in 813ms
   Skipping validation of types
```

Changed files:
filename: packages/next/src/build/webpack-build/impl.ts
patch: @@ -44,6 +44,11 @@ import { durationToString } from '../duration-to-string'
 
 const debug = origDebug('next:build:webpack-build')
 
+function hrtimeToSeconds(hrtime: [number, number]): number {
+  // hrtime is a tuple of [seconds, nanoseconds]
+  return hrtime[0] + hrtime[1] / 1e9
+}
+
 type CompilerResult = {
   errors: webpack.StatsError[]
   warnings: webpack.StatsError[]
@@ -333,7 +338,7 @@ export async function webpackBuildImpl(
     err.code = 'WEBPACK_ERRORS'
     throw err
   } else {
-    const duration = webpackBuildEnd[0]
+    const duration = hrtimeToSeconds(webpackBuildEnd)
     const durationString = durationToString(duration)
 
     if (result.warnings.length > 0) {
@@ -345,7 +350,7 @@ export async function webpackBuildImpl(
     }
 
     return {
-      duration: webpackBuildEnd[0],
+      duration,
       buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,
       pluginState: getPluginState(),
       telemetryState: {
Repository: ollama/ollama
Pull request: fix: add falcon.go

missed this file in #519 

Changed files:
filename: llm/falcon.go
patch: @@ -0,0 +1,22 @@
+package llm
+
+const ModelFamilyFalcon = "falcon"
+
+const (
+	falconModelType7B   = 32
+	falconModelType40B  = 60
+	falconModelType180B = 80
+)
+
+func falconModelType(numLayer uint32) string {
+	switch numLayer {
+	case 32:
+		return "7B"
+	case 60:
+		return "40B"
+	case 80:
+		return "180B"
+	default:
+		return "Unknown"
+	}
+}
Repository: denoland/deno
Pull request: fix: add another space after warning symbol

The warning symbol was overlapping the text in my terminal.

Changed files:
filename: cli/main.rs
patch: @@ -131,7 +131,7 @@ async fn run_subcommand(
     }),
     DenoSubcommand::Bundle(bundle_flags) => spawn_subcommand(async {
       log::warn!(
-        "⚠️ {} is experimental and subject to changes",
+        "⚠️  {} is experimental and subject to changes",
         colors::cyan("deno bundle")
       );
       tools::bundle::bundle(flags, bundle_flags).await
@@ -406,7 +406,7 @@ async fn run_subcommand(
       1,
     ),
     DenoSubcommand::Vendor => exit_with_message(
-      "⚠️ `deno vendor` was removed in Deno 2.\n\nSee the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
+      "⚠️  `deno vendor` was removed in Deno 2.\n\nSee the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
       1,
     ),
     DenoSubcommand::Publish(publish_flags) => spawn_subcommand(async {

filename: cli/tools/init/mod.rs
patch: @@ -313,7 +313,7 @@ async fn init_npm(name: &str, args: Vec<String>) -> Result<i32, AnyError> {
   if std::io::stdin().is_terminal() {
     log::info!(
       cstr!(
-        "⚠️ Do you fully trust <y>{}</> package? Deno will invoke code from it with all permissions. Do you want to continue? <p(245)>[y/n]</>"
+        "⚠️  Do you fully trust <y>{}</> package? Deno will invoke code from it with all permissions. Do you want to continue? <p(245)>[y/n]</>"
       ),
       script_name
     );

filename: libs/npm_installer/lib.rs
patch: @@ -254,6 +254,7 @@ impl<TNpmCacheHttpClient: NpmCacheHttpClient, TSys: NpmInstallerSys>
     packages: &[PackageReq],
     caching: PackageCaching<'_>,
   ) -> Result<(), JsErrorBox> {
+    self.npm_resolution_initializer.ensure_initialized().await?;
     self
       .add_package_reqs_raw(packages, Some(caching))
       .await

filename: tests/specs/vendor/removed/vendor.out
patch: @@ -1,3 +1,3 @@
-error: ⚠️ `deno vendor` was removed in Deno 2.
+error: ⚠️  `deno vendor` was removed in Deno 2.
 
 See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations
Repository: facebook/react
Pull request: Switch facebook-www build version to file content hash

Unifies the React version string pattern with RN just to simplify the build script a tiny bit and not have 2 mechanisms for the Meta-internal build.

Changed files:
filename: scripts/rollup/build-all-release-channels.js
patch: @@ -158,18 +158,16 @@ function processStable(buildDir) {
   }
 
   if (fs.existsSync(buildDir + '/facebook-www')) {
-    const hash = crypto.createHash('sha1');
     for (const fileName of fs.readdirSync(buildDir + '/facebook-www').sort()) {
       const filePath = buildDir + '/facebook-www/' + fileName;
       const stats = fs.statSync(filePath);
       if (!stats.isDirectory()) {
-        hash.update(fs.readFileSync(filePath));
         fs.renameSync(filePath, filePath.replace('.js', '.classic.js'));
       }
     }
     updatePlaceholderReactVersionInCompiledArtifacts(
       buildDir + '/facebook-www',
-      ReactVersion + '-www-classic-' + hash.digest('hex').slice(0, 8)
+      ReactVersion + '-www-classic-%FILEHASH%'
     );
   }
 
@@ -224,18 +222,16 @@ function processExperimental(buildDir, version) {
   }
 
   if (fs.existsSync(buildDir + '/facebook-www')) {
-    const hash = crypto.createHash('sha1');
     for (const fileName of fs.readdirSync(buildDir + '/facebook-www').sort()) {
       const filePath = buildDir + '/facebook-www/' + fileName;
       const stats = fs.statSync(filePath);
       if (!stats.isDirectory()) {
-        hash.update(fs.readFileSync(filePath));
         fs.renameSync(filePath, filePath.replace('.js', '.modern.js'));
       }
     }
     updatePlaceholderReactVersionInCompiledArtifacts(
       buildDir + '/facebook-www',
-      ReactVersion + '-www-modern-' + hash.digest('hex').slice(0, 8)
+      ReactVersion + '-www-modern-%FILEHASH%'
     );
   }
Repository: vercel/next.js
Pull request: Turbopack: use published sourcemap crate

#82641 was merged a bit soon

Closes PACK-5260

Changed files:
filename: Cargo.lock
patch: @@ -8245,8 +8245,9 @@ dependencies = [
 
 [[package]]
 name = "swc_sourcemap"
-version = "9.3.3"
-source = "git+https://github.com/mischnic/rust-sourcemap.git?branch=mischnic%2Fsource-content-mixup#a11f621393345e87145108da20dffb310b5dbfd4"
+version = "9.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de08ef00f816acdd1a58ee8a81c0e1a59eefef2093aefe5611f256fa6b64c4d7"
 dependencies = [
  "base64-simd 0.8.0",
  "bitvec",

filename: Cargo.toml
patch: @@ -426,7 +426,7 @@ smallvec = { version = "1.13.1", features = [
   "union",
   "const_new",
 ] }
-swc_sourcemap = "9.3.3"
+swc_sourcemap = "9.3.4"
 strsim = "0.11.1"
 shrink-to-fit = "0.2.10"
 syn = "2.0.100"
@@ -450,4 +450,3 @@ hyper = { git = "https://github.com/bgw/hyper-rs.git", branch = "v1.6.0-with-mac
 mdxjs = { git = "https://github.com/mischnic/mdxjs-rs.git", branch = "swc-core-32" }
 lightningcss = { git = "https://github.com/parcel-bundler/lightningcss.git", branch = "mischnic/bump-browserslist" }
 parcel_selectors = { git = "https://github.com/parcel-bundler/lightningcss.git", branch = "mischnic/bump-browserslist" }
-swc_sourcemap = { git = "https://github.com/mischnic/rust-sourcemap.git", branch = "mischnic/source-content-mixup" }
Repository: ollama/ollama
Pull request: Fix ggml arm64 linux cuda build

Apply patch to support CUDA's half type for aarch64

Changed files:
filename: llm/llama.cpp/generate_linux.go
patch: @@ -6,9 +6,10 @@ package llm
 //go:generate -command git-apply git -C ggml apply
 //go:generate git-apply ../ggml_patch/0001-add-detokenize-endpoint.patch
 //go:generate git-apply ../ggml_patch/0002-34B-model-support.patch
-//go:generate cmake -S ggml -B ggml/build/gpu -DLLAMA_CUBLAS=on -DLLAMA_ACCELERATE=on -DLLAMA_K_QUANTS=on 
+//go:generate git-apply ../ggml_patch/0005-ggml-support-CUDA-s-half-type-for-aarch64-1455-2670.patch
+//go:generate cmake -S ggml -B ggml/build/gpu -DLLAMA_CUBLAS=on -DLLAMA_ACCELERATE=on -DLLAMA_K_QUANTS=on
 //go:generate cmake --build ggml/build/gpu --target server --config Release
 
 //go:generate git submodule update --force gguf
-//go:generate cmake -S gguf -B gguf/build/gpu -DLLAMA_CUBLAS=on -DLLAMA_ACCELERATE=on -DLLAMA_K_QUANTS=on 
+//go:generate cmake -S gguf -B gguf/build/gpu -DLLAMA_CUBLAS=on -DLLAMA_ACCELERATE=on -DLLAMA_K_QUANTS=on
 //go:generate cmake --build gguf/build/gpu --target server --config Release

filename: llm/llama.cpp/ggml_patch/0005-ggml-support-CUDA-s-half-type-for-aarch64-1455-2670.patch
patch: @@ -0,0 +1,32 @@
+From 1e3bc523d8053a77df3ac7126a84d0297ee97ef6 Mon Sep 17 00:00:00 2001
+From: Kylin <56434533+KyL0N@users.noreply.github.com>
+Date: Tue, 22 Aug 2023 15:14:23 +0800
+Subject: [PATCH] ggml : support CUDA's half type for aarch64(#1455) (#2670)
+
+* ggml: support CUDA's half type for aarch64(#1455)
+support CUDA's half type for aarch64 in ggml_fp16_t definition
+
+* ggml: use __CUDACC__ to recognise nvcc compiler
+---
+ ggml.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/ggml.h b/ggml.h
+index 544ad2d..0ec7ec5 100644
+--- a/ggml.h
++++ b/ggml.h
+@@ -259,8 +259,9 @@
+ extern "C" {
+ #endif
+ 
+-#ifdef __ARM_NEON
+-    // we use the built-in 16-bit float type
++#if defined(__ARM_NEON) && defined(__CUDACC__)
++    typedef half ggml_fp16_t;
++#elif defined(__ARM_NEON)
+     typedef __fp16 ggml_fp16_t;
+ #else
+     typedef uint16_t ggml_fp16_t;
+-- 
+2.39.2 (Apple Git-143)
+