Comments (2)
Can you help me understand more about what you mean? Reg-passable types aren't going to be a thing controlled as they are now. When we adopt small buffer optimization to list, it's reasonable for it to just be a parameter (just like how the SSO size could be controlled at the String type parameter level). In which case, there won't be anything concrete to do here for this once all of Gabriel's SSO/SBO work lands.
from mojo.
Sorry I'll try to explain a good use case:
Say you have a char field and you know it's going to be mostly 48 byte strings, so classic 32 byte SBO for string doesn't cut it. You want an array that can handle custom and flexible SBO.
Say you then look at List's comming SBO that lets you add a buffer and when the item extends that buffer beyond capacity you have to deal with two different pointers, one for the SB and the other for the heap. If you have 3 typical lenghts (e.g. 48, 24, 16 bytes) you are dealing with, you will have to choose the biggest size for SBO and eat up the memory cost.
Following the example of having 48, 32, 24, 16 possiblities, say 25% for each. If you had a structure (the proposed Array) that has 5 transitions i.e. Array[UInt8, 16, 8, 48] for which each item is sized with the smallest fitting capacity, you wouldn't waste quite so much memory.
Another thing which is why the original Idea came up, is that there is no clear way to go from a List[Scalar]
(other than iterating and loading, and knowing about its existence) to a SIMD
vector. If Array could shift to internally using SIMD instead of the current inlineArray and List as heap, and be a user friendly interface for SIMD and vectorized ops.. that would be even better. Is there something like it already in the works? If so I'll just close the PR np
from mojo.
Related Issues (20)
- [BUG] errors on install HOT 2
- [Feature Request] [proposal] Fast but unsafe version of atol
- [BUG] Install Issue--Infected file warning (from Intego/Virusbarrier) HOT 2
- [BUG] Install Issue: Failed to run Script (mojo format) HOT 2
- [BUG] crash when attempting to use MAC mps when wrapping PyTorch
- [BUG] Possible SIMD[DType.bool, n] tested for truth in the stdlib where n > 1 HOT 5
- [BUG] Parser crash when a overload for a trait method is added
- [BUG] `Tensor` initialised from a list with wrong type shows weird behaviour
- [BUG] Parser crash when `moveinit` with wrong argument convention is defined while using `@value`
- [BUG] LSP & Mojo crashes when using Python.evaluate in a certain way HOT 4
- [Feature Request] [stdlib] [proposal] Add comp time `SIMD` range constructor
- [Feature Request] [stdlib] Add `assert_aborts()`
- Beğenilen
- [Modular CLI] Include mojo version in Max --version
- [BUG] Error output when using AOT mode but not JIT mode to run `llama3.mojo` HOT 1
- [BUG] Error output when using AOT mode but not JIT mode to run llama3.mojo
- [BUG] Error output when using AOT mode but not JIT mode to run `llama3.mojo`
- [BUG] Functions cannot be parsed during debugging.
- [Docs] Vectorize docs are outdated HOT 1
- [BUG] `String.removesuffix("")` removes entire string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mojo.