Source-controlled AI checks on every pull request. Standards as checks, enforced by AI, decided by humans.
Accelerating SQL query execution with GPUs is a central focus in database research. While prior systems have achieved notable speedups by offloading relational operators, the acceleration of the wide range of scalar functions that are supported by analytical engines remains unaddressed. Our analysis reveals that many scalar functions incur substantial computational overhead and often constitute the primary bottleneck in analytical queries on CPUs. Thisobservation motivates a systematic exploration of the opportunities and challenges in accelerating scalar functions on GPUs.Unlike relational operators, which are few in number and standardized, production databases support hundreds of scalar functions. The absence of a standardized specification, combined with this diversity, renders manual GPU porting infeasible. To address this, we present an LLVM-MLIR-based compiler toolchain that automatically translates the CPU-based implementations of scalar functions from production databases into efficient GPU kernels, while preserving their original semantics. Our approach lifts scalar functions to a high-level intermediate representation, applies resource-optimizing transformations, and generates GPU assembly code, supporting all relevant data types, parameters, and database context variables.As existing benchmarks do not sufficiently stress test scalar functions in analytical queries, we introduce a variant of TPC-H that utilizes scalar functions while preserving the original query intent. Integrating our GPU kernels into a state-of-the-art GPU data base system, we demonstrate substantial performance gains over a leading CPU database that uses slightly more expensive hardware: 7.6× on enhanced TPC-H and 6.4× on production queries, furtherwidening the gap between GPU and CPU databases. The generated kernels deliver performance comparable to hand-optimized GPU implementations, establishing our approach as a scalable and practical solution for accelerating scalar functions on GPUs.
Should I buy a 3D printer to print it? Will I likely make use of the printer again for desiging other parts or something? submitted by /u/boringblobking [link] [Kommentare]
Neutral interop + governance layer for multi-agent systems. Any protocol in, any protocol out, with identity, budgets, and a tamper-evident audit trail. - shadowhunter-92/agentbridge
Then we can prove: \[ \dfrac { \dfrac { \dfrac { \dfrac { y : \gg(x : 1). \surd 0 \prov y : \gg(x : 1). \surd 0 }{ y :: \gg(x : 1). \surd 0, \star \prov y\tri 2 : \surd 0 }}{ y :: \gg(x : 1). \surd 0 \prov \mathbf{el}_\surd\ ( y\tri 2) : 0 }}{ y :: \gg(x : 1). \surd 0 \prov \babort(\mathbf{el}_\surd\ ( y\tri 2)) : \T }}{ y : \gg(x : 1). \surd 0 \prov {\triangle}(\babort(\mathbf{el}_\surd\ ( y\tri 2))) : \T } \] We can be careful and check that $\mathsf{fore}_2$ is really a type: \[ \dfrac { \dfrac { \dfrac{ \dfrac{} { C \div \surd \rtype, \star \prov C : \rtype } } { C \div \surd \rtype \prov \mathbf{el}_\surd C : \rtype } } { \cdots \prov \surd (\mathbf{el}_\surd C) : \rtype } \quad \dfrac{ \dfrac{ \dfrac{} { \cdots, \star \prov a' : \surd(\mathsf{fore}_1\ C\ t) } } { \cdots \prov \mathbf{el}_\surd\ a' : \mathsf{fore}_1\ C\ t } \quad \dfrac{} { \cdots \prov a : \mathsf{fore}_1\ C\ t } } { \cdots, a' : \surd (\mathbf{el}_\surd C) \prov \mathbf{el}_\surd\ a' \equiv a : \rtype } } { C : \surd \rtype, t : \T, a : \mathsf{fore}_1\ C\ t \prov (a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a) : \rtype } \] Let's try to see if anything interesting happens when we do some round-trips. The computation of $\mathsf{back}$ of $\mathsf{fore}$ gives: \[\mathsf{back}\ (\mathsf{fore}_1\ C)\ (\mathsf{fore}_2\ C) \] \[= \mathbf{in}_\surd\ (\gg(a : \mathsf{fore}_1\ C\ \star).(\mathsf{fore}_2\ C\ \star\ a)) \] \[= \mathbf{in}_\surd\ (\gg(a : \mathbf{el}_\surd\ C).( (a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a) ) \] so we'd want to show this is equal to $C$ at $\surd \rtype$. Although I can rely on univalence to tell me what equality of types means, I need to pin down what equality at $\surd$ means! Maybe there's some kind of extensionality; that all I need is equality under eliminations. Is this equality plausible semantically? If I hit with $\dash^*$ I get \[(\mathbf{in}_\surd\ (\gg(a : \mathbf{el}_\surd\ C).( (a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a) ))^* \] \[= \pair{X^*}{ \sem X} \] for \[ X = \gg(a : \mathbf{el}_\surd\ C).( (a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a) ) \] and I'd find (using some very sketchy reasoning at certain steps, but I think this is still vaguely plausible. I need to be more careful reasoning about universes and elements, I think) \[ \pair{X^*}{ \sem X} = \pair {(\mathbf{el}_\surd\ C)^*} {\lambda a^* : (\mathbf{el}_\surd\ C)^* . (a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a)^* }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ((a' : \surd (\mathbf{el}_\surd C)) \x (\mathbf{el}_\surd\ a' \equiv a))^* }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ({a'}^* : (\surd (\mathbf{el}_\surd C))^*) \x (\mathbf{el}_\surd\ a' \equiv a)^* }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ({a'}^* : (\surd (\mathbf{el}_\surd C))^*) \x ({a'}^*.1 \equiv a^*) }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ({a'}^* : (y^* : (\mathbf{el}_\surd C)^*) \x \sem{\mathbf{el}_\surd C}(y^*)) \x ({a'}^*.1 \equiv a^*) }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ({a'}^* : (y^* : C^*.1) \x C^*.2\ y^*) \x ({a'}^*.1 \equiv a^*) }\] \[ = \pair {C^*.1} {\lambda a^* : (C^*.1) . ( C^*.2\ a^*) }\] \[ = \pair {C^*.1} {C^*.2 }\] \[ = C\] Let's try the other direction. Assume $A : \T \to \rtype$ and $B : (t : \T)(a : A\ t) \to \rtype$. We expect $\mathsf{fore}_1\ (\mathsf{back}\ A\ B)\ t = A\ t$ so we compute \[ \mathsf{fore}_1\ (\mathsf{back}\ A\ B)\ t = \mathbf{el}_\surd\ (\mathsf{back}\ A\ B) \] \[= \mathbf{el}_\surd\ (\mathbf{in}_\surd\ (\gg(a : A\ \star).(B\ \star\ a))) \] \[= \gg(a : A\ \star).(B\ \star\ a) \] At let's now compare semantics. We have a $t : \T$ present, so we only need to check the base, not the relation, for we can use $\sem \T(\_) = 0$ to abort. And indeed …