laurent.orseau
2022-5-5 09:58:33

I tried to use for/async with in-hash and that didn’t work (at all). The body of the for seems to be future-friendly (fold/fold, in-flvector, flvector-set! and fixnum and flonum operations). Does in-hash being the culprit sound plausible? If so, can there be a way around it that doesn’t involve converting the hash?


laurent.orseau
2022-5-5 10:10:26

Worst case, I’m still interested to know whether converting the hash would likely solve my issue actually—but this is not a trivial change as it impacts other things


samth
2022-5-5 13:21:34

Didn’t work as in there was no speed up?


samth
2022-5-5 13:21:56

My recommendation would be a non-equal hash if that works


laurent.orseau
2022-5-5 13:38:57

I’m using a hasheq with fixnums and there was a large slowdown compared to the serial version


samth
2022-5-5 13:39:30

Can you try using in-hasheq?


laurent.orseau
2022-5-5 13:41:08

Wait, is that a thing? It doesn’t exist in the docs


samth
2022-5-5 13:41:26

Oh sorry, I thought it was


laurent.orseau
2022-5-5 13:42:07

too bad, that would have been a good candidate :slightly_smiling_face:


samth
2022-5-5 13:42:24

There is in-immutable-hash


laurent.orseau
2022-5-5 13:44:16

That would require a conversion I suppose. If I go down the conversion path, I’d better turn my hash into two large flvectors. Maybe I should do that.


samth
2022-5-5 13:44:59

Oh it’s a mutable hash? Then you could also try in-immutable-hash


laurent.orseau
2022-5-5 13:45:19

interesting—also, suprising!


laurent.orseau
2022-5-5 13:47:57

Or do you mean in-mutable-hash instead?


samth
2022-5-5 13:48:19

Argh it autocorrected me


laurent.orseau
2022-5-5 13:49:47

(test running, it takes several minutes to complete)


laurent.orseau
2022-5-5 14:01:58

Nope, doesn’t work: cpu: 234435 real: 88593 gc: 62230


samth
2022-5-5 14:04:06

That’s a 4x speed up, but I assume slower than serial


samth
2022-5-5 14:04:19

3x


laurent.orseau
2022-5-5 14:04:43

Except that the serial version actually runs in ~1s. (Sorry for the misleading timings above)


samth
2022-5-5 14:05:01

Yikes


samth
2022-5-5 14:06:18

Also how many futures is that creating?


samth
2022-5-5 14:06:30

Have you used the future visualizer?


laurent.orseau
2022-5-5 14:07:49

(processor-count) reports 96


laurent.orseau
2022-5-5 14:08:06

I haven’t tried the vizualizer yet (trying now)


laurent.orseau
2022-5-5 14:30:02

On a smaller example the visualizer says 0 blocks and 0 syncs, but the execution is rather spread out


laurent.orseau
2022-5-5 14:33:42

Oh it could be because each iteration of the loop is actually way too fast, and the cost of instantiating futures is larger than that.


laurent.orseau
2022-5-5 14:36:21

Ideally, for/async would know how many iterations N are to be done, and perform N/(processor-count) of them serially in each future, rather than instanciating one future per iteration


laurent.orseau
2022-5-5 14:51:20

It doesn’t seem easy to do that with a hash and manual futures, but that should be fairly straightforward with a long indexable vector instead. Thanks for your help!


tibajoel90
2022-5-5 16:26:17

@tibajoel90 has joined the channel


tibajoel90
2022-5-5 16:34:15
  1. Study the implementation of the following data science abstractions in the code base of https://github.com/n3mo/data-science and describe their different levels of data and/or procedure abstraction layers. Provide a diagram showing the different abstractions levels per abstraction. (a) linear-model (b) list->sentiment (c) read-csv (d) qq-plot* (e) hist The data science abstractions offer support for sentiment analysis, a technique that is commonly used to quickly determine the mood, or emotional valence of a body of text.

tibajoel90
2022-5-5 16:35:02

For example, using the system to analyze the mood of words for textual novels provided by Stories and Fiction http://textfiles.com/stories/ yields the following results.


tibajoel90
2022-5-5 16:35:35

tibajoel90
2022-5-5 16:36:07

hey everyone, kindly need help with this… any help rendered will be highly appreciated


spdegabrielle
2022-5-5 17:34:24

Hi @tibajoel90 Welcome to the Racket Slack:slightly_smiling_face:

Lots of people ask for help and it is often not clear exactly what they are asking…so we put together some guidance ; > > <https://github.com/racket/racket/wiki/How-to-get-help#how-to-ask-for-help|How to ask for help> > > Here’s a checklist to make things easier when asking for help, in order: > > > 1. What is the task? > 2. How far have you come? (Provide the smallest working example of your problem if you can) > 3. What exactly are you struggling with? > 4. What approaches have you tried to solve it?

Try answer each of the four questions when asking - and please ask in #beginners


spdegabrielle
2022-5-5 17:44:16

Do you mind if I ask what school you attend and who is your professor? It is always nice to hear of another course using Racket :heart:


tibajoel90
2022-5-5 18:39:20

hey @spdegabrielle thanks for the welcome and guidance on how to ask questions. its makerere university in Uganda


tibajoel90
2022-5-5 18:40:08

let me formulate and use #beginners channel, thanks


shaobo
2022-5-5 19:56:35

@capfredf any updates on this issue?


capfredf
2022-5-5 19:57:04

I haven’t got time to look into it yet


shaobo
2022-5-5 19:57:59

I see. It seems to be something related to provide all-defined-out.


shaobo
2022-5-5 19:58:28

Once I removed it, Racket finishes very quickly.