or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/cupy-cuda101@9.6.x
tile.json

tessl/pypi-cupy-cuda101

tessl install tessl/pypi-cupy-cuda101@9.6.0

CuPy: NumPy & SciPy for GPU (CUDA 10.1 version)

Agent Success

Agent success rate when using this tile

87%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

73%

task.mdevals/scenario-6/

Student Grade Ranker

Build a student grade ranking system that processes and ranks students based on multiple criteria using GPU-accelerated array operations.

Problem Description

You need to implement a function that takes student data (IDs, scores across multiple subjects) and produces a ranked list of students based on a multi-level sorting criteria. The ranking should be performed efficiently using GPU acceleration.

Requirements

Input Data Format

Your solution should accept the following inputs:

  • student_ids: A 1D array of unique integer student IDs
  • subject_scores: A 2D array where each row represents a subject and each column represents a student's score in that subject
  • priority_order: A 1D array specifying the order of subjects for ranking (indices into the rows of subject_scores)

Ranking Logic

Students should be ranked using lexicographic (multi-key) sorting:

  1. Primary sort key: scores in the highest priority subject (first index in priority_order)
  2. Secondary sort key: scores in the next priority subject (second index in priority_order)
  3. Continue for all subjects specified in priority_order
  4. All sorting should be in descending order (highest scores ranked first)

Output Format

Return a 1D array of student IDs in ranked order (best student first).

Implementation Guidelines

  1. Create a file ranker.py with a function rank_students(student_ids, subject_scores, priority_order)
  2. The function should accept arrays (can be NumPy or GPU arrays) as inputs
  3. The function should return a 1D array of student IDs sorted by the ranking criteria
  4. Use GPU-accelerated operations for efficient multi-key sorting
  5. The solution should handle tie-breaking correctly when multiple students have the same score in a subject

Test Cases

  • Given student_ids [101, 102, 103, 104] and subject_scores [[85, 92, 85, 88], [90, 85, 88, 90], [88, 88, 92, 85]] with priority_order [0, 1, 2], the function returns [102, 104, 103, 101] @test

  • Given student_ids [201, 202, 203] with tied scores in the first subject and different scores in subsequent subjects, the function correctly breaks ties using secondary priority subjects @test

  • Given student_ids [301, 302, 303] and a non-default priority_order [1, 0, 2], the function correctly ranks students according to the specified subject priority @test

Dependencies { .dependencies }

cupy { .dependency }

Provides GPU-accelerated array computing with NumPy-compatible API for efficient numerical operations.

@satisfied-by

@generates