BFloat16s.jl: Nobody Needed All Those Bits anyway

BFloat16s

This package defines the BFloat16 data type. The only currently available hardware implementation of this datatype are Google's Cloud TPUs. As such, this package is suitable to evaluate whether using TPUs would cause precision problems for any particular algorithm, even without access to TPU hardware. Note that this package is designed for functionality, not performance, so this package should be used for precision experiments only, not performance experiments.

Usage

This package exports the BFloat16 data type. This datatype should behave just like any builtin floating point type (e.g. you can construct it from other floating point types - e.g. BFloat16(1.0)). In addition, this package provides the LowPrecArray type. This array is supposed to emulate the kind of matmul operation that TPUs do well (BFloat16 multiply with Float32 accumulate). Broadcasts and scalar operations are peformed in Float32 (as they would be on a TPU) while matrix multiplies are performed in BFloat16 with Float32 accumulates, e.g.

julia> A = LowPrecArray(rand(Float32, 5, 5))
5×5 LowPrecArray{2,Array{Float32,2}}:
 0.252818  0.619702   0.553199  0.75225   0.30819
 0.166347  0.976339   0.399945  0.589101  0.526253
 0.350232  0.0447034  0.490874  0.525144  0.841436
 0.903734  0.879541   0.706704  0.304369  0.951702
 0.308417  0.645731   0.65906   0.636451  0.765263

julia> A^2
5×5 LowPrecArray{2,Array{Float32,2}}:
 1.13603   1.64932  1.39712  1.27283  1.82597
 1.03891   1.93298  1.44455  1.42625  1.86842
 0.998384  1.28403  1.37666  1.24076  1.68507
 1.18951   2.33245  2.04367  2.26849  2.35588
 1.22636   1.90367  1.70848  1.63986  2.1826

julia> A.storage^2
5×5 Array{Float32,2}:
 1.13564  1.64708  1.39399  1.27087  1.82128
 1.03924  1.93216  1.44198  1.42456  1.86497
 1.00201  1.28786  1.37826  1.24295  1.6882
 1.19089  2.33262  2.04094  2.26745  2.354
 1.22742  1.90498  1.70653  1.63928  2.18076

julia> Float64.(A.storage)^2
5×5 Array{Float64,2}:
 1.13564  1.64708  1.39399  1.27087  1.82128
 1.03924  1.93216  1.44198  1.42456  1.86497
 1.00201  1.28786  1.37826  1.24295  1.6882
 1.19089  2.33262  2.04094  2.26745  2.354
 1.22742  1.90498  1.70653  1.63928  2.18076

Note that the low precision result differs from (is less precise than) the result computed in Float32 arithmetic (which matches the result in Float64 precision).

Download Details:

Author: JuliaMath
Source Code: https://github.com/JuliaMath/BFloat16s.jl 
License: View license

#julia #data #type 

What is GEEK

Buddha Community

BFloat16s.jl: Nobody Needed All Those Bits anyway

BFloat16s.jl: Nobody Needed All Those Bits anyway

BFloat16s

This package defines the BFloat16 data type. The only currently available hardware implementation of this datatype are Google's Cloud TPUs. As such, this package is suitable to evaluate whether using TPUs would cause precision problems for any particular algorithm, even without access to TPU hardware. Note that this package is designed for functionality, not performance, so this package should be used for precision experiments only, not performance experiments.

Usage

This package exports the BFloat16 data type. This datatype should behave just like any builtin floating point type (e.g. you can construct it from other floating point types - e.g. BFloat16(1.0)). In addition, this package provides the LowPrecArray type. This array is supposed to emulate the kind of matmul operation that TPUs do well (BFloat16 multiply with Float32 accumulate). Broadcasts and scalar operations are peformed in Float32 (as they would be on a TPU) while matrix multiplies are performed in BFloat16 with Float32 accumulates, e.g.

julia> A = LowPrecArray(rand(Float32, 5, 5))
5×5 LowPrecArray{2,Array{Float32,2}}:
 0.252818  0.619702   0.553199  0.75225   0.30819
 0.166347  0.976339   0.399945  0.589101  0.526253
 0.350232  0.0447034  0.490874  0.525144  0.841436
 0.903734  0.879541   0.706704  0.304369  0.951702
 0.308417  0.645731   0.65906   0.636451  0.765263

julia> A^2
5×5 LowPrecArray{2,Array{Float32,2}}:
 1.13603   1.64932  1.39712  1.27283  1.82597
 1.03891   1.93298  1.44455  1.42625  1.86842
 0.998384  1.28403  1.37666  1.24076  1.68507
 1.18951   2.33245  2.04367  2.26849  2.35588
 1.22636   1.90367  1.70848  1.63986  2.1826

julia> A.storage^2
5×5 Array{Float32,2}:
 1.13564  1.64708  1.39399  1.27087  1.82128
 1.03924  1.93216  1.44198  1.42456  1.86497
 1.00201  1.28786  1.37826  1.24295  1.6882
 1.19089  2.33262  2.04094  2.26745  2.354
 1.22742  1.90498  1.70653  1.63928  2.18076

julia> Float64.(A.storage)^2
5×5 Array{Float64,2}:
 1.13564  1.64708  1.39399  1.27087  1.82128
 1.03924  1.93216  1.44198  1.42456  1.86497
 1.00201  1.28786  1.37826  1.24295  1.6882
 1.19089  2.33262  2.04094  2.26745  2.354
 1.22742  1.90498  1.70653  1.63928  2.18076

Note that the low precision result differs from (is less precise than) the result computed in Float32 arithmetic (which matches the result in Float64 precision).

Download Details:

Author: JuliaMath
Source Code: https://github.com/JuliaMath/BFloat16s.jl 
License: View license

#julia #data #type 

The buzz around 64-bit Architecture for Mobile Applications: Everything you need to know

Google announced that from August 2019, all the 32-bit apps on the Google Play store must have a 64-bit version also, and added that they would be stopping the support of 32-bit apps from 2021.
Android had capabilities to support 64-bit versions for several years, and hence most of the Top mobile app development companies were prepared for this news.

The 64-bit transition was imminent as the gains made in speed, efficiency and cost-savings far outweigh the likely troubles to be faced by the app developers. Google announcement on this will be followed closely by the developers. The future is 64-bit, and you will need to build 64-bit apps if you want to future proof your app. An excellent mobile app development company will guide you in building efficient 64-bit apps.

Read More: The buzz around 64-bit Architecture for Mobile Applications: Everything you need to know

#excellent mobile app development company #top mobile app development companies #best app developers #64-bit architecture #64-bit app

LargeColumns.jl: Manage Large Vectors Of Bits Types in Julia

LargeColumns 

Manage large vectors of bits types in Julia. A thin wrapper for mmapped binary data, with a few sanity checks and convenience functions.

Specification

For each dataset, the columns (vectors of equal length) and metadata are stored in a directory like this:

dir/
├── layout.jld2
├── meta/
│   └ ...
├── 1.bin
├── 2.bin
├── ...
├── ...
└── ...

The file layout.jld2 specifies the number and types of columns (using JLD2.jl, and the total number of elements. The $i.bin files contain the data for each column, which can be memory mapped.

Additional metadata can be saved as in files in the directory meta. This is ignored by this library; use the function meta_path to calculate paths relative to dir/meta.

Interfaces

Two interfaces are provided. Use SinkColumns for an ex ante unknown number of elements, written sequentially. This is useful for ingesting data.

MmappedColumns is useful when the number of records is known and fixed.

Types for the columns are specified as Tuples. See the docstrings for both interfaces and the unit tests for examples.

Acknowledgments

Work on this library was supported by the Austrian National Bank Jubiläumsfonds grant 17378.

Download Details:

Author: tpapp
Source Code: https://github.com/tpapp/LargeColumns.jl 
License: View license

#julia #bit #types 

Abdullah  Kozey

Abdullah Kozey

1625479620

Find, Set, Clear, Toggle and Modify bits in C

Given a positive integer N, the task is to perform the following sequence of operations on the binary representation of N in C.

  • Finding a bit: Find the Kth bit in binary representation of N.
  • Setting a bit: If Kth bit is 0, then set it to 1. Otherwise, leave it unchanged.
  • Clearing a bit: If Kth bit is 1, then clear it to 0. Otherwise, leave it unchanged.
  • Toggling a bit: If Kth bit is 1, then change it to 0 and vice-versa.
  • Modifying a bit: Replace the Kth bit with a given bit.

#bit magic #mathematical #technical scripter #bit algorithms

Ian  Robinson

Ian Robinson

1623938520

Do I need Big Data? And if so, how much?

Many companies follow the hype of big data without understanding the implications of the technology.

I call myself a “Big Data Expert”. I have tamed many animals in the ever growing Hadoop zoo like HBase, Hive, Oozie, Spark, Kafka, etc… I helped companies to build and structure their Data Lake using appropriate subsets of these technologies. I like to wrangle with data from multiple sources to generate new insights (or to confirm old insights with evidence). I love to build Machine Learning models for predictive applications. So, yes, I would say that I am well experienced with many facets of what people would call “Big Data”.

But at the same time, I became more and more skeptical of blindingly following the promises and the hype without understanding all the consequences and without evaluating the alternatives.

#hadoop #big-data #nosql #do i need big data? and if so, how much? #need big data