Advanced CPU functions support in Python numerical libraries
B. Nikolic Software and Computing Blog
by Bojan Nikolic
3w ago
Numpy Numpy supports dynamic dispatch based on supported CPU features. See https://numpy.org/devdocs/reference/simd/build-options.html for documentation. Pre-built wheels appear to support all the new features. In Python can find out supported features by using the numpy.__config__.show() call: >>> numpy.__config__.show() openblas64__info: libraries = ['openblas64_', 'openblas64_'] library_dirs = ['/usr/local/lib'] language = c define_macros = [('HAVE_CBLAS', None), ('BLAS_SYMBOL_SUFFIX', '64_'), ('HAVE_BLAS_ILP64', None)] runtime_library_dirs = ['/usr/local/lib ..read more
Visit website
Is Git a system designed for single source of truth?
B. Nikolic Software and Computing Blog
by Bojan Nikolic
4M ago
First thing to say, keeping information in Git is much closer to single-source-of-truth than keeping it only in peoples heads, or on pieces of paper scattered around offices, or on inaccessible/incompatible systems. So in many cases using Git for single source of truth is much of an improvement compared to what was done previously. But, Git was not designed to be a “single-source-of-truth”. In fact, before the conception of Git but over some time, it was realised that software source code management does not fit in well into the single source of truth idea. The reasons behind are that inevitab ..read more
Visit website
Seasonal adjustment in Azure Synapse using sktime
B. Nikolic Software and Computing Blog
by Bojan Nikolic
5M ago
This is a simple demonstration using the Microsoft Azure Synapse platform to process data using Python. The example data I user are ONS UK HPI data. The UK housing data tend to have a significant seasonal component. I used pandas (https://pandas.pydata.org/) to load/manipulate the data and SKTime to analyse the timeseries to calculate the seasonality adjusted series. HVplot is used for plotting. The data are stored and the notebook run entirely on Azure Synapse. Notebook 1¶ In [26]: import panel as pn import pandas as pd import hvplot.pandas from sktime.param_est.seasonality import Se ..read more
Visit website
Building the Python interpreter and Python packages from known sources
B. Nikolic Software and Computing Blog
by Bojan Nikolic
6M ago
A quick note how to build the Python interpreter and any Python packages needed in a way: Is all built from exactly known sources which can be archived The build can be reproduced The final build can be isolated from the network entirely This is implemented as a three stage Docker file. The first stage prepares the basic O/S. The second stage is essentially used only to download the sources of the Python interpreter and the packages; but since in Python packages need to be installed in order to determine all of the their dependencies there in fact can be a lot of building in this step. The f ..read more
Visit website
Using Nix as un-privileged user
B. Nikolic Software and Computing Blog
by Bojan Nikolic
6M ago
Notes on how to install and use Nix as a reproducible build/pkg manager without needing any special privileges on a Linux-like system. The nix store can be on any location writeable by the user and the cached derivations can still be used. This post is inspired by https://zameermanji.com/blog/2023/3/26/using-nix-without-root/ with some additions/updates: The store location can be specified to any directory Use configuration file to avoid having to spell out the store location How to use nix profiles Get a static version of nix You can get the list of current versions form Hydra and download ..read more
Visit website
Isolated Python on Windows using Sandboxes
B. Nikolic Software and Computing Blog
by Bojan Nikolic
6M ago
It is generally it is a good minimise the trust given to any particular piece software, and this especially applies when using a diverse set of packages prepared by many different organisations and individual community members. Here are notes on completely isolating Python and its any needed selection of pip-installable packages. A two stage processes is needed: First an isolated environment with network access to download the required Python packages. NB this environment has no access to any local data Subsequently an isolated environment without network access but with access to selected lo ..read more
Visit website
Notes on somewhat reducing trust of third-party Python packages
B. Nikolic Software and Computing Blog
by Bojan Nikolic
6M ago
Python has a phenomenal ecosystem of third-party packages. But, by its very nature, using third-party packages means trusting third-party code. And while it seems there have been very few attempts at security exploits through these packages, how would one try to reduce how much we trust this third party code? Isolate Either container approach (eg. with podman or docker ) or firejail. This isolates the general filesystem, system services, UNIX sockets etc. Anything which is actually needed by the code being used can (and needs to) be made accessible explicitly. Source code provenance Many Pytho ..read more
Visit website
How to use fully isolated Large Language Models in Windows
B. Nikolic Software and Computing Blog
by Bojan Nikolic
7M ago
Here are some notes on how to run Large Language Models fully isolated from all network connections on MS Windows. This is not ChatGPT but a similar open-source implementation that can be driven with a variety of downloadable weights (which basically are the knowledge of the model). This approach allows computation with LLMs on air-gapped systems, on temporarily disconnected secure machines, secure virtual machines, or, as in this case, Windows Sandbox built-in easy-to-use isolated VMs. Use of a carefully isolated machines is essential for work where valuable or important data or information i ..read more
Visit website
BPF monitoring with user stack attribution and the frame pointer
B. Nikolic Software and Computing Blog
by Bojan Nikolic
1y ago
Extended Berkeley Packet Filter (eBPF/BPF) is a fully programmable way of collecting information and changing behaviour from inside the Linux kernel. Amongst it’s many uses collecting information of what limits the performance of a system as a whole or of specific applications. From its Kernel viewpoint, BPF has unique ability to collect information about I/O, networking and other aspects of overall performance that often dominates simple computational throughput in importance. There are numerous such tools in the bcc collection: https://github.com/iovisor/bcc. On Debian they are available as ..read more
Visit website
SWIG bindings for llama.cpp into Java/JVM, C#/CLR, etc
B. Nikolic Software and Computing Blog
by Bojan Nikolic
1y ago
LLama.cpp is a popular simplified implementation of LLaMa models in pure C++/C. It already has ctypes-based Python bindings as well Go, Node.js. This is a just a quick note that I’ve implemented basic SWIG-based wrapper which amongst other can build Java/JVM binding (already implemented) and also C#/CLR, and many other languages. The binding is available at: https://github.com/bnikolic/llama.swig A very basic example demonstrating just that the wrapper can load: package examples; import uk.co.bnikolic.LLamaWrap; public class Simple { public static void main(String[] args) throws Except ..read more
Visit website

Follow B. Nikolic Software and Computing Blog on FeedSpot

Continue with Google
Continue with Apple
OR