# GPU Module Changelog

_This page documents the version history of the KDB-X [GPU module](../introduction.md), including released versions, fixes, and improvements._

## 3.0.0

**Release date**: 2026-11-09

This release adds the `.gpu.tensor` API and a simpler interface through one module with virtual GPU objects, descending sorts, per-call device selection, and correctness fixes that make GPU results match q.

**New**

* Added the [`.gpu.tensor`](../reference.md#tensor) API for typed tensor data on the GPU: arithmetic and broadcasting, reductions and running scans, moving windows, sorting, linear algebra (`mmu`, `inv`, `chol`, `lsq`, and principal component analysis (PCA)), concatenation, `take` and `view`, NumPy-style indexing (`gather`), and type conversion. Results stay on the GPU and interoperate with q data.
* Added [`.gpu.xdesc`](../reference.md#xdesc) and [`.gpu.idesc`](../reference.md#idesc), the descending counterparts of `.gpu.xasc` and `.gpu.iasc`.
* Added [`.gpu.onDev[d;f]`](../reference.md#ondev), which runs `f` with device `d` current and restores the previous device when it returns or signals, for per-call device selection under `peach`. The reference now documents that [`.gpu.setDev`](../reference.md#setdev) is per host thread.
* Query expressions now support GUID columns in `min`, `max`, `&`, `|`, `mins`, `maxs`, `mmin`, `mmax`, and ordering comparisons.

**Breaking changes**

* `` .gpu:use`gpu `` returns GPU results as virtual objects and the separate `` use`g `` module is removed. Every `.gpu` and `.gpu.tensor` function keeps its name and signature and still accepts q data; plain q `select`, `exec`, `select[n]`, `lj`, `ij`, `aj`, `wj`, `xasc`, `meta`, `cols`, and `xkey` work on GPU tables. q primitives do not see inside a virtual object; see [GPU objects](../reference.md#gpu-objects).
* The `` use`g `` names `.gpu.qry` and `.gpu.device`, the `.gpu.tensor` groups `aggs`, `scans`, `moving` and `linear`, and the aliases `dve`, `xexp`, `flip`, `upsert`, and `random.rng` are gone; use the `.gpu`/`.gpu.tensor` names in the [reference](../reference.md).

**Fixes and improvements**

* **Joins and searches:** Single-key `.gpu.aj`, `.gpu.bin`, `.gpu.lj`, `.gpu.ij`, `.gpu.wj`, and `.gpu.wj1` are faster on attributed key columns, which now include byte and month. The as-of join family matches enum keys across different domains and keeps q's null-time and window behavior. Mixed-type `in` follows q's rules, and `xbar` with real, float or datetime divisors now matches q in previously divergent cases.
* **Floating-point fidelity:** Comparisons, casts and grouped keys now match q's comparison tolerance (`1f=1+2 xexp -44` is `1b`), subnormal and NaN handling, signed zeros and datetime keys in grouping, `` `g# `` lookups and sorts, and rounding in float-to-integer casts.
* **Aggregates and scans:** Aggregates of aggregates under `by`, constant aggregates per group, scans and moving operations of atoms, scalar booleans combined with per-row conditions, empty `by` grouping, seeded `fills` and `wavg` with atom operands now match q. Grouped integer sums wrap on overflow as q does.
* **Data transfer:** A CUDA error during `.gpu.to` or `.gpu.from` now reports a q error instead of ending the session. Failed uploads and appends release their resources and leave the target intact. `.j.j` serializes GPU-resident columns.
* **Nested columns:** `.gpu.take` and `.gpu.sublist` slice a nested column by rows, as q does. Operations that cannot support nested columns report an error instead of returning wrong results.
* **Memory and performance:** Memory freed after an operation is kept for reuse, speeding up repeated queries. Empty `.gpu.take` and `.gpu.sublist` results stay on the GPU, and grouped (`` `g# ``) appends keep a correct index.
* **Fixes:** `.gpu.count` of a keyed table returns the row count; the empty select phrase no longer returns row numbers for a column named `i`; `.gpu.sublist` clamps negative counts like q; datetime columns sort without aborting the q session; GUID result columns in joins are copied at the right width and grouped GUID indexes no longer crash; unknown names in query expressions error instead of being read as data.

## 2.9.0

**Release date**: 2026-10-20

This release skips sorting for inputs that are already sorted, adds memory compaction with `.gpu.compact`, and fixes several bugs.

**Fixes and improvements**

* Fixed null and out-of-range fills in [`.gpu.gather`](../reference.md#gather) and SQL column re-indexing for real, float, datetime, char, and symbol columns, including a symbol result corruption that could crash q. `.gpu.gather` now also accepts short and int index vectors, CPU-resident or GPU-resident.
* [`.gpu.aj`](../reference.md#aj) and [`.gpu.bin`](../reference.md#bin) now support 4-byte columns: int, month, date, minute, second, and time as the ordered column, and int as an equality column.
* [`.gpu.asc`](../reference.md#asc), [`.gpu.iasc`](../reference.md#iasc), and [`.gpu.xasc`](../reference.md#xasc) skip the sort when the input already has the `` `s `` attribute.
* Added [`.gpu.compact`](../reference.md#compact) to reclaim the capacity a GPU-resident object reserved for appending. Like a global amend in q, it signals `noupdate` from a secondary thread.
* Setting a `global`-scope setting of [`.gpu.config`](../reference.md#config) from a secondary thread now signals `noupdate`, as `.gpu.compact` does. Reading configuration is unaffected.
* Implemented [`.gpu.select`](../reference.md#select) and [`.gpu.update`](../reference.md#update) column re-indexing, including nested re-indexing, composition with operations such as `iasc`, and support for `where` and `by`. Functional `iasc` symbol-vector arguments support arbitrary depth and follow q's right-to-left application semantics. For example, ``(iasc;`source`index1`index2)`` is interpreted as `iasc source[index1[index2]]`.
* Accelerated first-clause `=` and `in` filters in `.gpu.select` and `.gpu.update` using the grouped (`` `g ``) attribute. Supports all column types except byte, month, and deprecated datetime.

## 2.8.0

**Release date**: 2026-09-01

Exec form of `.gpu.select`.

**Fixes and improvements**

* [`.gpu.select`](../reference.md#select) now supports exec forms: the shapes of the `by` and phrase arguments choose between select and exec semantics, as in native q.
* Fixed some incorrect temporal casts.

## 2.7.0

**Release date**: 2026-08-26

Runtime configuration with `.gpu.config`, `fby` and `.gpu.ungroup` support, and sort, allocation, and comparison fixes.

**Fixes and improvements**

* Added [`.gpu.config`](../reference.md#config) to get or set runtime configuration.
* Added the `alloc` setting to `.gpu.config`, choosing power-of-two device allocations (`` `buddy ``, the default and previous behavior) or exact-size ones (`` `tight ``). `` `tight `` cuts VRAM for data that isn't appended to, at the cost of every append reallocating.
* Added [`.gpu.ungroup`](../reference.md#ungroup).
* Added support for [`fby`](../reference.md#fby) in `.gpu.select` and `.gpu.update`.
* Added support for [`.gpu.append`](../reference.md#appending-by-name) taking a symbol atom naming a global as its first argument. It appends to that global and returns the symbol, similar to `` `t upsert y ``.
* Added support in `.gpu.select` for comparing an enumerated symbol column (type `20h`) to a symbol atom (type `11h`) with `=` and `<>`. For example:
  ```q
  q)T:.gpu.to ([]s:`sym$`AAPL`MSFT`AAPL;p:150 300 152)
  q).gpu.from .gpu.select[T;enlist(=;`s;enlist`AAPL);0b;()]
  ```

* Deprecated `.gpu.setMemRelThres` and `.gpu.getMemRelThres` in favor of the `memRelThres` setting of `.gpu.config`.
* Fixed `.gpu.asc`, `.gpu.xasc` and two-key `.gpu.aj` failing with an allocation error on empty input.
* Fixed `.gpu.asc` sorting against a null buffer, and `.gpu.to` failing silently, on an allocation failure.
* Fixed a comparison against a scalar returning wrong values in its last rows.
* Fixed incorrect sort order in `.gpu.xasc`, `.gpu.asc`, and `.gpu.iasc` when sorting on an enumerated symbol column with a large enumeration domain.
* Fixed incorrect sort order in `.gpu.xasc`, `.gpu.asc`, and `.gpu.iasc` when sorting on an enumerated symbol column whose enumeration domain has more entries than the table has rows.
* Fixed copy-on-write semantics of `.gpu.append`.
* Fixed a `GPU_LAUNCH_FAIL` error when sorting on multiple columns, seen on some GPU architectures.

## 2.6.2

**Release date**: 2026-08-14

Where clauses rework.

**Fixes and improvements**

* Reworked how where clauses are applied to improve performance for highly selective queries.

## 2.6.1

**Release date**: 2026-08-12

Blackwell `sm_120` architecture support.

**Fixes and improvements**

* Added support for the `sm_120` architecture of Blackwell.

To find the correct version for your GPU, run `nvidia-smi --query-gpu=compute_cap` and multiply by 10 (for example, `10.0` → `100`, `12.0` → `120`).

## 2.6.0

**Release date**: 2026-08-12

Inner join, window join, covariance, correlation, and update support, additional `.gpu.select` operations, and `.gpu.select` fixes.

**Fixes and improvements**

* Added support for inner join `.gpu.ij`.
* Added support for window joins `.gpu.wj` and `.gpu.wj1`, with `sum`, `min`, `max`, `count`, `avg`, `first`, and `last` aggregations.
* Added support for covariance, sample covariance, and correlation with `.gpu.cov`, `.gpu.scov`, and `.gpu.cor` for GPU-resident float vectors.
* Added support for `rank` and `xrank` in `.gpu.select`.
* Added support for `iasc` with a `by` clause in `.gpu.select`.
* Added support for `.gpu.update`.
* Fixed `iasc` under a `where` clause in `.gpu.select` to match native q.
* Fixed a bug in `.gpu.select` that caused some operations to fail on boolean expressions.

## 2.5.0

**Release date**: 2026-07-28

This release adds support for Blackwell, additional `.gpu.select` operations, and `.gpu.lj`; it also improves performance and allocation-failure handling.

**Fixes and improvements**

* Added support for left join `.gpu.lj`.
* Added support for `ema` in `.gpu.select`.
* Improved group-by sort performance in `.gpu.select`.
* Fixed a bug that terminated the process after an allocation failure instead of returning a recoverable error.
* Fixed a crash on an empty input to `.gpu.select`.
* Added Blackwell (sm_100) support.

## 2.4.0

**Release date**: 2026-07-16

Additional `.gpu.select` operation support and a `groupby` fix.

**Fixes and improvements**

* Added support for `fill` (`^`) and `fills` (`^\`) in `.gpu.select`.
* Added support for `ratios` and `deltas` in `.gpu.select`.
* Added support for `prev`, `xprev`, and `next` in `.gpu.select`.
* Fixed a bug in `.gpu.select` that manifested as missing results in a `groupby` operation.

## 2.3.0

**Release date**: 2026-06-30

Windowed scan operations & Sort performance improvements.

**Fixes and improvements**

* Added support for `msum`, `mmin`, `mmax` and `mdev` in `.gpu.select`.
* Improved multi-column sort performance in `.gpu.xasc`, `.gpu.asc`, and `.gpu.iasc`.

## 2.2.0

**Release date**: 2026-06-15

Scan operations, keyed tables, and performance improvements.

**Fixes and improvements**

* Added support for `prds`, `mins`, and `maxs` in `.gpu.select`.
* Added support for keyed tables, which are now returned from `.gpu.select` with a `by` clause.
* Improved `.gpu.select` performance by avoiding casts with bit-identical input and output.

## 2.1.0

**Release date**: 2026-06-02

Scan operation support and fixes.

**Fixes and improvements**

* Added support for `sums` and `xexp` in `.gpu.select`.
* Allowed non-GPU-resident columns in `.gpu.xasc`. Sorting on such columns (that is, the lhs arguments) remains unsupported.
* Fixed `.gpu.select` to broadcast atomic results to match the size of other columns.
* Fixed a crash in `.gpu.take` when trying to create very large tables.
* Fixed `.gpu.gather` handling of null indices to match q semantics. Null indices now produce null output values instead of incorrectly reading from index `0`.

## 2.0.0

**Release date**: 2026-05-19

Nested data and richer `.gpu.select`.

**Fixes and improvements**

* Added support for columns of lists (1 level deep only). This enables `mavg` inside a `.gpu.select` with a `by` clause.
* Improved sorting performance.
* Improved aggregate performance in `.gpu.select`.
* Added greater operator support in `.gpu.select`: casting, `dev`, `first`, `iasc`, `in`, `last`, `mavg`, `sqrt`, `var`, `wavg`, `within`, and `xbar`.
* Removed the requirement for an aggregate in the `select` phrase when using `.gpu.select` with a `by` clause.
* Fixed integer-sum overflow.
* Exposed GPU memory pool configuration through `.gpu.setMemRelThres` and `.gpu.getMemRelThres`. For more information, refer to [CUDA memory pool documentation](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY__POOLS.html#group__CUDART__MEMORY__POOLS_1g0229135f7ef724b4f479a435ca300af5).
* Exposed `cudaProfilerStart` and `cudaProfilerStop` through `.gpu.profiler.start` and `.gpu.profiler.stop`.
* Renamed device management functions: `ndev` to `cntDev`, `gdev` to `getDev`, `sdev` to `setDev`, and `mdev` to `memDev`.

## 1.0.1

**Release date**: 2026-04-30

Release fix.

**Fixes and improvements**

* Support for CUDA 12 alongside CUDA 13.
* Fixed build issue with some 1.0.0 packages.

## 1.0.0

**Release date**: 2026-03-31

Initial Release

**Fixes and improvements**

N/A
