OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomese-simd commits / 75687d4

Expand the README
75687d4312cd2f67a52f779ad7b43fdf49f98afe
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-12T17:25:01.000Z

Changed files (2) +56 -10

Design-C.md +1 -1
……@@ -227,7 +227,7 @@ Open Discussion
227227---------------
228228Some philosophical questions remain as to "object permanence". Vectors
229229and the `cl::Buffer` that wrap them disappear when the last reference to
230the enclosing `OpenclFloatValue` disappears. Thus, such storage locatins
230the enclosing `OpenclFloatValue` disappears. Thus, such storage locations
231231were impermanent: at play for the duration of the duration of the
232232calculation, and then gone. This is analogous to both the CPU hardware
233233and compiler ideas of "register retirement": they're gone, once the
README.md +55 -9
……@@ -1,16 +1,62 @@
11
2Atomse SIMD (OpenCL/CUDA) Interfaces
2Atomese SIMD (OpenCL/CUDA) Interfaces
33====================================
44Experimental effort to enable I/O between Atomese and SIMD compute
5resouces. The primary target is commodity GPUs, running either OpenCL
5resources. The primary target is commodity GPUs, running either OpenCL
66or CUDA. The current prototype accesses the hardware at a low level,
77working with individual vectors. High-level API's, such as commonly
88used in deep learning, are not supported in this interface layer.
99
10[Atomese](https://wiki.opencog.org/w/Atomese), the interface language for
11the OpenCog [AtomSpace](https://github.com/opencog/atomspace) hypergraph
12database, has a variety of different ways of talking to external
13subsystems. These include:
10The experiment, as it is currently evolving, is to understand graph
11rewriting between "natural" descriptions of compute systems. For
12example, the "natural" description of a deep learning transformer is
13a kind of wiring diagram, indicating where data flows. By contrast, the
14"natural" description of GPU compute kernels are C/C++ function
15prototypes. How can one perform the rewrite from the high-level
16description to the low-level description? Normally, this is done "brute
17force": a human programmer sits down and writes a large pile of GPU
18code, creating systems like PyTorch or TensorFlow. The experiment here
19is to automate the glueing together from high-level to low-level
20descriptions.
21
22Such automation resembles what compilers do. For example, a C++ compiler
23accepts C++ code and issues machine assembly code. A Java compiler
24accepts Java and issues Java bytecode. The goal here is to accept
25high-level functional descriptions, such as that of a transformer, and
26to generate low-level invocations of GPU kernels. However, the project
27here is not meant to be a "compiler" per se; if that is what one really
28wanted, one could just brute-force write one (or use PyTorch,
29TensorFlow, ...) Instead, this is meant to be an exploration of graph
30rewriting in general, and the GPU target just happens to be a realistic
31and suitably complicated example target.
32
33A different way of thinking of this experiment is as an exploration of
34the agency of sensori-motor systems. The GPU is a "thing out there" that
35can be manipulated by an agent to "do things". How does one perceive the
36"thing out there", and describe it's properties? How can one control it
37and perform actions on it? To extert motor control on that "thing out
38there"? How does one perceive the results of those motor actions?
39
40In the present experiment, the "agent" is is a collection of graphs
41(properly, hypergraphs), represented using
42[Atomese](https://wiki.opencog.org/w/Atomese),
43and "living" in the OpenCog
44[AtomSpace](https://github.com/opencog/atomspace).
45That is, the subjective inner form of the agent is a world-model,
46consisting of abstractions derived from sensory perceptions of the
47external world, and a set of motor actions that can be performed to
48alter the state of the external world. The agent itself is constructed
49from Atomese; the GPU is a part of the external world, to be manipulated.
50
51The abvoe description might feel like excessive anthropomorphising of
52a mechanical system. But that's kind of the point: to force the issue,
53and explore what happens, when an agentic viewpoint is explicitly
54forced.
55
56[Atomese](https://wiki.opencog.org/w/Atomese) is the interface language
57for the OpenCog [AtomSpace](https://github.com/opencog/atomspace)
58hypergraph database. It has a variety of different ways of talking to
59external subsystems. These include:
1460
1561* The [GroundedSchemaNode](https://wiki.opencog.org/w/GroundedSchemaNode)
1662 allows external python, scheme and shared-library functions to be
……@@ -81,8 +127,8 @@ residing in the AtomSpace.
81127
82128New in this version: Atomese interface descriptions are now generated
83129for OpenCL kernel interfaces. This should allow introspection of the
84interfaces, and their manipulation in Atomese. Well see how that goes.
85The groundwork is there.
130interfaces, and their manipulation in Atomese. We'll see how that goes.
131Some problems are already visible. But some groundwork is there.
86132
87133The demo is minimal, but it works. Tested on both AMD Radeon R9 and
88134Nvidia RTX cards.
……@@ -127,7 +173,7 @@ Steps:
127173* Build and install cogutils, the AtomSpace, sensory and then the code
128174 here. This uses the same build style as all other OpenCog projects:
129175 `mkdir build; cd build; cmake ..; make; sudo make install`
130* Run unit tests: `make check`. If the unit tests fail, that's proably
176* Run unit tests: `make check`. If the unit tests fail, that's probably
131177 because they could not find and GPU hardware. See below.
132178* Look over the examples. Run them
133179 `cd examples; guile -s atomese-kernel.scm`