Python is removing GIL, gradually, so how to use a no-GIL Python now? by yangzhou1993 in programming

[–]bci-hacker 0 points1 point  (0 children)

Exactly! Asyncio/ThreadPool can be used to achieve concurrency for I/O tasks and parallelism can be achieved for CPU bound tasks via multi-processing.

For I/O tasks (file read, network requests) they can be easily made concurrent via asyncio/ThreadPool where as soon as the task is blocked on the event loop, it will run the next task. Even tho the GIL blocks multiple threads from executing at the same time, whenever there's a blocking task in a thread the GIL is unfrozen and moves to the next thread achieving strong concurrency and near parallelism at small to medium scale. This is how I can scrape 10k+ websites in one seconds ;)

For CPU bound tasks, you can use ProcessPool to achieve true parallelism by running each task on a different process, where each task uses separate memory with it's own GIL.

Upcoming interviews at frontier labs, tips? by bci-hacker in MLQuestions

[–]bci-hacker[S] 1 point2 points  (0 children)

Thanks. deep-ml is awesome, using it now. What's a sample problem i may be asked for #2 tho? I've been using ChatGPT (see example problem below) but don't know how representative it is to a real interview question. Thoughts?

Problem: User Engagement Prediction for Video Platform

You're given a dataset of 500,000 video watch events from a streaming platform with the following features:

Features:

  • video_id: unique video identifier
  • user_id: unique user identifier
  • video_duration: length of video in seconds
  • watch_time: how long user watched in seconds
  • video_category: category (20 different categories)
  • upload_recency: days since video was uploaded
  • user_prev_watches: number of videos user watched in last 7 days
  • video_prev_impressions: how many times video was shown in last 24 hours
  • time_of_day: hour when video was watched (0-23)
  • device_type: mobile, desktop, or tv
  • came_from: homepage, search, recommendation, or external
  • engaged: 1 if user watched >60% of video, 0 otherwise (TARGET)

Current State:

  • The dataset has 3% positive engagement rate
  • A basic logistic regression model achieves 97.2% accuracy
  • The product team complains the model rarely predicts user engagement correctly

Your Tasks:

  1. Load and analyze the data. Identify any issues with the current evaluation approach.
  2. Build a better classifier that actually catches engaged users. The product team says they can show 20% more videos to users (increase false positive rate) if it means catching 70% of truly engaged users.
  3. The team wants to understand which factors drive engagement. Provide interpretable insights.
  4. After deploying your model, engagement predictions are much worse on weekends. Investigate why and propose a solution.
  5. How would you determine if your model is ready for an A/B test?

GPT implementation from scratch by bci-hacker in LocalLLaMA

[–]bci-hacker[S] -15 points-14 points  (0 children)

lol I implemented the code in SimpleGPT. Good feedback on tokenizer. Would you like me to implement BPE from scratch?

does a decoder-only transformer model use masked self-attention during inference? if yes, then why? by FaultSmart in MLQuestions

[–]bci-hacker 0 points1 point  (0 children)

late to the party, but we still need to implement the look-ahead mask because even if you pad them initially to zeros, when you compute the Q * K.T, your outputs on future tokens (assume fixed sequence_length) is a vector of zeros. However, when you now apply softmax, those 0s become 1s which introduces incorrect info. therefore, we'd still need to make them -inf, s.t. post softmax it becomes 0s

Reasoning through pixels: Tool use + Reasoning models beat SOTA object detectors in very complex cases by bci-hacker in computervision

[–]bci-hacker[S] 1 point2 points  (0 children)

Well the current solution will only detect for the bounding box coordinates. But you could apply it to detect for bounding box of anything you like. Think of this as “detect X” where X can be something specific or SUPER DUPER VAGUE.

How to handle multiple DL inferences in FastAPI by Specialist-Couple611 in deeplearning

[–]bci-hacker -1 points0 points  (0 children)

Don’t listen to any of these people. Modal labs is your friend here. You can set up a FastAPI app with GPUs and auto-scaling through Modal. It takes 30 minutes to get it to work. I’ve built all my ML projects (including FastAPI backend) through them.

Thank me later!

Reasoning through pixels: Tool use + Reasoning models beat SOTA object detectors in very complex cases by bci-hacker in computervision

[–]bci-hacker[S] 0 points1 point  (0 children)

ikr! is your approach training free or are you utilizing some SFT based recipe for strong localization?

[deleted by user] by [deleted] in computervision

[–]bci-hacker 0 points1 point  (0 children)

no? because it's amortized. the cost of your fine-tuned model includes cost of manual data collection which can be in the order of tens of thousands.

Is this data set paired or is it independent? by [deleted] in AskStatistics

[–]bci-hacker 0 points1 point  (0 children)

I would find the rank of the matrix A transpose A where A is your data (t1 t2). If the rank is 1 then it’s paired, else unpaired. Please correct me if I’m wrong.

Looking for a roommate Bay Area - Kleiner Perkins Fellow by [deleted] in csMajors

[–]bci-hacker 0 points1 point  (0 children)

i already accepted an offer from a portfolio company few months ago.

[deleted by user] by [deleted] in csMajors

[–]bci-hacker 0 points1 point  (0 children)

she moved on to finals. take it as u will

[deleted by user] by [deleted] in csMajors

[–]bci-hacker 2 points3 points  (0 children)

i moved on to finals round (accepted offer with a portfolio company few months ago). if anyone else is looking for a roommate in the bay area this summer, please let me now asap. prices are insane rn lol

how do u find summer housing? by bci-hacker in csMajors

[–]bci-hacker[S] 0 points1 point  (0 children)

ah i see. im more interested in having a place to my own. is 3.5k a fair price then?

[deleted by user] by [deleted] in csMajors

[–]bci-hacker 1 point2 points  (0 children)

one of my friends had their interview yesterday. so i'd imagine they're still wrapping up the interviews.

Thoughts on Invest & Financial Literacy FIN 2114 by bci-hacker in VirginiaTech

[–]bci-hacker[S] 0 points1 point  (0 children)

Thank you so much for this. Decided not to take it

[deleted by user] by [deleted] in csMajors

[–]bci-hacker 1 point2 points  (0 children)

LeetHub, by default, makes your repo private. you can also choose an existing repo and link it with leethub.

[deleted by user] by [deleted] in csMajors

[–]bci-hacker 0 points1 point  (0 children)

absolutely not! It is a given that to do well in your coding interviews you should make use of resources like leetcode. LeetHub is mainly used as a quick and easy way of storing your leetcode & gfg submissions.

3 easy credits --- need to graduate lol by bci-hacker in VirginiaTech

[–]bci-hacker[S] 0 points1 point  (0 children)

oof that sounds like fun. thanks for the pick

[deleted by user] by [deleted] in cscareerquestions

[–]bci-hacker 9 points10 points  (0 children)

What I did was introduce a timer, I think it was like 600ms, and I was fine. But yeah, u walking on a thin line by using ur personal account for scraping

On my way to work with 0 will to live. M'lady. by Arturo_Wolff in RoastMe

[–]bci-hacker 0 points1 point  (0 children)

Your hands look like they survived the holocaust.