2,014 questions
1
vote
1
answer
131
views
why the order of return variables affect the jax jitted function's performance so much?
In jax, you can donate a function argument to save the execute memory and time, if this argument is not used any more.
If you know that one of the inputs is not needed after the computation, and if ...
0
votes
1
answer
163
views
Passing 4 arguments to a JIT function with 4 parameters raises "TypeError: jit() takes 1 positional argument but 5 positional arguments"
For GPU optimized simulations I have a function where the head looks like this:
import jax
from functools import partial
@partial(partial, jax.jit, static_argnums=(2,4))
def init_particles_grid(...
Advice
1
vote
1
replies
61
views
Adding stack information to jit'd code for sanitization
Disclaimer: I'm expecting that the answer to this question will be that it can't be done, but I'm asking as a just in case.
I am working on a JIT'd language with the compiler and runtime implemented ...
2
votes
1
answer
127
views
Sequential compilation times of a jax-jitted recursive function
I have a recursively defined function my_func that is jitted using jax.jit from the jax library. It is defined below:
# Imports
import jax
import jax.numpy as jnp
from functools import partial
import ...
3
votes
1
answer
57
views
Unexpected recompilation of method - JVM
Let look at the log from XX:+PrintCompilation:
Time Tier Method
11:20:24 3 m
11:24:14 3 m made not entrant
11:24:15 2 ...
3
votes
2
answers
606
views
Making an absolute 64-bit jump in x64 assembler which can be copied as a JIT
I am trying to port some code from linux to windows. I need to assemble a jump to an absolute address, using nasm, such that the same bytes will jump to the same address, no matter where the code is ...
4
votes
2
answers
240
views
Why is the the generic implementation of Vector.Log so much slower than the non-generic implementations for me?
I've run some benchmarks on Math.Log, System.Numerics.Vector.Log, System.Runtime.Intrinsics.Vector128.Log, Vector256.Log and Vector512.Log and the results were pretty surprising to me. I was expecting ...
0
votes
0
answers
147
views
About JVM's tiered compilation sequence, does isolated method optimization occur before inlining?
The tiered steps provided by Oracle are:
It seems to me that...
I'd be a reasonable assumption to think that optimizations should occur with methods in isolation (detached from its call-site context),...
1
vote
0
answers
81
views
LAPACK Inconsistent across multiple different operating systems and devices
Description
I have a deterministic program that uses jax, and is heavy on linear algebra operations.
I ran this code on CPU, using three different CPUs. Two MacOs Systems (one on Sequoia (M1 Pro), ...
-1
votes
1
answer
257
views
js v8 function inlining
I'm intresed how and in what cases V8 perform inlining.
I know that V8 can inline functions to eliminate call cost, but i dont konw the rules for it to happen.
I got how it works in obvious cases, ...
3
votes
0
answers
88
views
How does Python debugger honor the editing of script during execution?
I understand that Python interpreter will compiles source code during parsing just like what compiler for C does, which makes me curious why Python debugger can honor the editing during execution?
Say,...
0
votes
1
answer
57
views
What's the right way to determine which kind of cl_program I have?
The OpenCL API has one object which is sort of a "kitchen sink" for a lot of stuff: The program (with handle type cl_program). It can hold:
A textual program source ( ...
1
vote
1
answer
96
views
numba.njit signature for a list of jitclass objects
I am trying to pass a list of jitclass objects to a jitted function, but I've been unable to find a suitable type signature for njit. I don't understand well how Numba thinks, so I would really ...
1
vote
1
answer
136
views
js v8 computed property names and inline cache
as far as my understanding go, in v8 if property access occurs on object with persistent shape jit optimize it to prety much struct acces that is just offsetting a pointer but is the same rules ...
1
vote
0
answers
43
views
Cross platform exceptions in llvm jit
I'm trying to implement exceptions in a language with llvm jit, Well not exceptions really but a panic system, that unwinds the stack to specific point and destroys local variables, I chose to use ...
1
vote
1
answer
106
views
Jax / Flax potential tracing issue
I'm currently using Flax for neural network implementations. My model takes two inputs:
x and θ. It first processes x through an LSTM, then concatenates the LSTM's output with θ — or more precisely, ...
0
votes
0
answers
100
views
Numba jitclass instance array element cannot be changed based on later code
I have a numba jitclass with an instance attribute that is a 1d-array of floats, initialized to be zeros (in the MRE as [0.,0.]).
I have a jitted function that creates an instance of said class and ...
0
votes
1
answer
49
views
What are the OpenCL devices "associated with a program"?
The clCompileProgram() function of OpenCL takes, among other parameters, a cl_program handle named program, and a list of device handles: cl_device* device_list. The documentation for this function ...
0
votes
1
answer
43
views
Why does clLinkProgram take a context handle?
In OpenCL, the clLinkProgram() function takes (among other things)
A cl_context context handle;
An array of cl_program handles of program objects.
Now, a cl_program is always created in a context; ...
-2
votes
1
answer
159
views
Reflection API and JVM and JIT [closed]
The compiler compiles the source code into bytecode that is then converted into machine code by the JVM or the JIT compiler. If the JIT compiler converts the bytecode to machine code then there is no ...
1
vote
0
answers
89
views
clBuildProgram vs clCompileProgram - when should I call each of these?
In regular software development parlance, we begin with program sources; we then compile them into binary objects; and finally link the objects them into an executable object. And the entire process ...
2
votes
1
answer
559
views
TracerBoolConversion error while attempting to use @jit on functions
In an effort to optimize an existing function used in an optimization algorithm by applying @jit, I encountered some issues. When running the following function:
import jax
import jax.numpy as jnp
...
1
vote
2
answers
102
views
How does the Julia JIT compiler handle return values from functions?
I am trying to get a better conceptual understanding of how the Julia JIT compilation process (perhaps better phrased as "compilation sequence") works.
Specifically, I am interested to know ...
20
votes
1
answer
2k
views
Why does this simple and small Java code runs 30x faster in all Graal JVMs but not on any Oracle JVMs?
I'm not compiling anything to native, in other words, I'm not using native-image from GraalVM. I'm just running the same Java class (same Java bytecode) with GraalVM and then running the same Java ...
16
votes
3
answers
1k
views
C++ implementation of a simple map slower than equivalent implementation in Java: Code/Benchmark Issue?
The goal of this research is to explore the performance differences between JIT (just-in-time compilation) and AOT (ahead-of-time compilation) strategies and to understand their respective advantages ...
1
vote
1
answer
443
views
jax and flax not playing nicely with each other
I want to implement a neural network with multiple LSTM gates stacked one after the other.I set the hidden states to 0, as suggested here. When I try to run the code, I get
JaxTransformError: Jax ...
1
vote
2
answers
686
views
With .NET 9 escape analysis, are struct and class now equal? [closed]
From a memory allocation point of view structs (in most cases) get allocated on the stack and classes get allocated on the heap. Each having their own tradeoffs. And struct vs class is always included ...
1
vote
1
answer
112
views
Spooky behaviour of JAX
This is a follow-up to my previous question. I am implementing a Parameterized Quantum Circuit as a Quantum Neural Network, where the optimization loop is jitted. Although there's no error, everything ...
0
votes
1
answer
133
views
Strange interaction between reshaping and type casting in Numba
I have noticed that when I pass a 2d array of 0s and 1s into a Numba njit function, reshape it, and then cast it to np.int32 or numba.int32, the resulting array when printed is different.
Here is ...
4
votes
1
answer
620
views
Cannot run Swift code on my windows system due to JIT session error
I'm getting a JIT session error when I'm running my swift program in vscode. How do I run this without the error?
My terminal
[Running] swift "d:\Metropolia\Swift_new\demo.swift"
JIT session ...
3
votes
1
answer
2k
views
JIT: partial or with static argnums? Non hashable input, but hashable partial
I am a bit lost on what exactly going on and what option to choose. Let's go trough an example:
import jax
from functools import partial
from typing import List
def dummy(a: int, b: List[str]):
...
1
vote
0
answers
145
views
multiprocessing and shared memory
I am trying to get the basics of multiprocessing in python. I have a quite complex routine that takes a large array (c.a 1Gb) and a double as inputs and returns a double. The large array is not going ...
0
votes
1
answer
420
views
Angular Errors during JIT compilation when upgrading to Angular 15 to Angular 18
I have just been upgrading a project form Angular 15 to Angular 18 and ran into a bunch of JIT errors when running my unit tests as follows
Errors during JIT compilation of template for _CdkTable: ...
1
vote
1
answer
123
views
Code to handle arbitrary number of for loops in Python/Numba
I have a function compiled under the 'njit' framework in Numba. It looks like this:
import numpy as np
from numba import njit, types, prange
from numba.typed import List
@njit(cache=CACHE_FLAG)
def ...
1
vote
2
answers
938
views
Migration from Node 14 to Node 18 - The injectable 'PlatformNavigation' needs to be compiled using the JIT compiler, but '@angular/compiler'
Recently I updated Node 14 to Node 18.20.4. I changed templates and related components so when I executed ng serve there were no errors in terminal console. However, when I execute npm run start or ...
0
votes
0
answers
46
views
How can we instruct local .NET runtime to JIT the same way as in a core dump from production?
I have two dumps from production and both of them JIT the method System.ComponentModel.Composition.Hosting.CompositionLock.LockComposition from the System.ComponentModel.Composition.dll assembly like ...
0
votes
0
answers
1k
views
Advice on how to speed up jax compilation times?
I want to implement the Legendre approximation of Dahlke&Pacheco 2020 to compute the entropy of a Gaussian Mixture Model.
I want to incorporate this into some deep learning I have in Jax, so I ...
0
votes
1
answer
86
views
Getting JIT compilation of template error while creating dynamic angular HTML
Getting JIT compilation of template error while creating dynamic angular HTML, refer the below screenshot. Angular HTML code not resolving.
Here is the stackblitz code:
Steps to reproduce:
Click on ...
1
vote
1
answer
662
views
Jax jitting of kd-tree code taking an intractably long amount of time
I've written myself into a corner with the following situation:
I'm running an optimiser which requires smooth gradients to work, and I'm using Jax for automatic differentiation. Since this code is ...
2
votes
2
answers
707
views
Dictionary indexing with Numpy/Jax
I'm writing an interpolation routine and have a dictionary which stores the function values at the fitting points. Ideally, the dictionary keys would be 2D Numpy arrays of the fitting point ...
0
votes
1
answer
297
views
GPU Not Computing using python
ACER Laptop with RTX3070. Installed CUDA, cuDNN, Tensorflow.
Tensorflow detecting GPU.
CUDA test script detecting GPU and shows GPU stats.
Trying to run this jit script to test GPU computing but ...
1
vote
0
answers
31
views
Want to know the inernal mach of Numba JIT
From https://llvmlite.readthedocs.io/en/latest/user-guide/binding/examples.html, I made up the following code, aiming to understand the procedure of Numba JIT.
from __future__ import print_function
...
0
votes
0
answers
56
views
How to do JIT in another AppDomain?
The code is shown below。There are Two DefaultDomain in Process,and i need to do JIT in DefaultDomain, NGEN's AppDomin Can JIT,but another cant.
var Domains = GetAllAppDomains();
foreach (var domain ...
0
votes
0
answers
64
views
Allocating complex data (btVector3) on the stack in LLVM IR
I want to use LLVM to JIT compile some code in my game using the LLVM C/C++ API. The JIT compiled functions should be able to effect the physics of the world, which is handled by bullet3.
To do so I ...
0
votes
0
answers
81
views
Numba throws `type error` for my gradient descent
I am trying to build my MNIST Classifier from scratch in Numba, but it throws the error of type error for np.dot(), however, when I run these functions without NUMBA Jit, I find out all the types are ...
0
votes
2
answers
1k
views
Angular 18 -- Error: The injectable 'Http2' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available
I am upgrading an old project of mine from Angular ~7 to ~18. After fixing ALL the TS warnings and errors, the project compiles successfully. However, when I run npm start and hit localhost:4200 I am ...
0
votes
0
answers
141
views
Is there a way to reference colors in Tailwind config from a package in Angular?
I am working on an Angular 17 app that uses Tailwind for styling.
This app references an Angular package that I also created, which exports a const that store config for colors:
// In package:
export ...
0
votes
1
answer
158
views
'CPUDispatcher' object is not subscriptable error
I am trying to process a very large csv file. The csv file (companies.csv) contains a list of companies with a column of postal codes and some other columns. I have postalcode.csv file containing ...
1
vote
1
answer
544
views
Why JAX is considering same list as different data structure depending on appending a new array inside function?
I am very new to JAX. Please excuse me if this something obvious or I am making some stupid mistake. I am trying to implement a function which does the following. All these functions will be called ...
1
vote
1
answer
368
views
How to use uprobes on Java JIT'd methods?
I want to use Uprobe in eBPF to trace the Java program I wrote, but I do not know how to find the symbol table corresponding to the Java program. When I find https://github.com/jvm-profiling-tools/...